Skip to content

Commit 2512148

Browse files
authored
Re-enable GeoJSON dataId test (#2420)
1 parent d376c5c commit 2512148

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -557,29 +557,22 @@ internal class StyleIntegrationTests: MapViewIntegrationTestCase {
557557
XCTAssertTrue(exaggerationTransitionProperty is NSNull)
558558
}
559559

560-
func testOnlyAddedDataIdReturned() throws {
561-
throw XCTSkip("Disabled due to behavior change, investigated in https://mapbox.atlassian.net/browse/MAPSIOS-1708")
562-
560+
func testAddedSourceDataIdReturned() throws {
563561
let source = GeoJSONSource(id: "Source")
564-
let source2 = GeoJSONSource(id: "Source2")
565562
let geometry = Geometry.point(Point.init(LocationCoordinate2D(latitude: 0, longitude: 0)))
566563
let dataId = "TestdataId"
567564
let expectation = XCTestExpectation(description: "dataId returned when source updated")
568565
expectation.expectedFulfillmentCount = 1
569566
expectation.assertForOverFulfill = true
570567

571-
var returnedSourceDataId: String?
572-
573-
try! mapView.mapboxMap.addSource(source)
574-
try! mapView.mapboxMap.addSource(source2)
575-
576568
mapView.mapboxMap.onSourceDataLoaded.observe { event in
577-
returnedSourceDataId = event.dataId
578-
XCTAssertEqual(returnedSourceDataId, dataId)
569+
guard event.dataId == dataId else { return }
579570

580571
expectation.fulfill()
581572
}.store(in: &cancelables)
582573

574+
try! mapView.mapboxMap.addSource(source)
575+
583576
mapView.mapboxMap.updateGeoJSONSource(withId: source.id, geoJSON: .geometry(geometry), dataId: dataId)
584577

585578
wait(for: [expectation], timeout: 3.0)

0 commit comments

Comments
 (0)