From 25121481c52f1e09ab3b44be310be107f65f8709 Mon Sep 17 00:00:00 2001 From: Roman Laitarenko Date: Wed, 22 Jan 2025 15:32:08 +0200 Subject: [PATCH] Re-enable GeoJSON dataId test (#2420) --- .../Style/StyleIntegrationTests.swift | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift b/Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift index dfc62a8be8a..520a3c2a885 100644 --- a/Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift +++ b/Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift @@ -557,29 +557,22 @@ internal class StyleIntegrationTests: MapViewIntegrationTestCase { XCTAssertTrue(exaggerationTransitionProperty is NSNull) } - func testOnlyAddedDataIdReturned() throws { - throw XCTSkip("Disabled due to behavior change, investigated in https://mapbox.atlassian.net/browse/MAPSIOS-1708") - + func testAddedSourceDataIdReturned() throws { let source = GeoJSONSource(id: "Source") - let source2 = GeoJSONSource(id: "Source2") let geometry = Geometry.point(Point.init(LocationCoordinate2D(latitude: 0, longitude: 0))) let dataId = "TestdataId" let expectation = XCTestExpectation(description: "dataId returned when source updated") expectation.expectedFulfillmentCount = 1 expectation.assertForOverFulfill = true - var returnedSourceDataId: String? - - try! mapView.mapboxMap.addSource(source) - try! mapView.mapboxMap.addSource(source2) - mapView.mapboxMap.onSourceDataLoaded.observe { event in - returnedSourceDataId = event.dataId - XCTAssertEqual(returnedSourceDataId, dataId) + guard event.dataId == dataId else { return } expectation.fulfill() }.store(in: &cancelables) + try! mapView.mapboxMap.addSource(source) + mapView.mapboxMap.updateGeoJSONSource(withId: source.id, geoJSON: .geometry(geometry), dataId: dataId) wait(for: [expectation], timeout: 3.0)