Skip to content

Commit

Permalink
Re-enable GeoJSON dataId test (#2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
evil159 authored Jan 22, 2025
1 parent d376c5c commit 2512148
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions Tests/MapboxMapsTests/Style/StyleIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2512148

Please sign in to comment.