Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
mltbnz committed Sep 14, 2024
1 parent 2c7f645 commit 2bc19ad
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions CriticalMapsKit/Tests/AppFeatureTests/AppFeatureCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,24 +275,30 @@ final class AppFeatureTests: XCTestCase {
}
}

@MainActor
func test_mapAction_focusEvent() async throws {
throw XCTSkip("Seems to have issues comparing $bottomSheetPosition")

var state = AppFeature.State()
state.bottomSheetPosition = .absolute(1)

let testClock = TestClock()

let store = TestStore(
initialState: state,
reducer: { AppFeature() }
reducer: { AppFeature() },
withDependencies: {
$0.continuousClock = testClock
$0.mainQueue = .immediate
}
)
store.dependencies.mainQueue = .immediate
store.exhaustivity = .off(showSkippedAssertions: false)

let coordinate = Coordinate.make()

await store.send(.map(.focusRideEvent(coordinate))) {
$0.mapFeatureState.eventCenter = CoordinateRegion(center: coordinate.asCLLocationCoordinate)
}
await store.receive(.binding(.set(\.$bottomSheetPosition, .relative(0.4))))
await testClock.advance(by: .seconds(1))
await store.receive(.map(.resetRideEventCenter)) {
$0.mapFeatureState.eventCenter = nil
}
Expand Down

0 comments on commit 2bc19ad

Please sign in to comment.