@@ -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