Skip to content

Commit

Permalink
add test for didTapNextEventBanner
Browse files Browse the repository at this point in the history
  • Loading branch information
mltbnz committed Sep 30, 2024
1 parent af5443e commit 2a41956
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CriticalMapsKit/Tests/AppFeatureTests/AppFeatureCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,24 @@ final class AppFeatureTests: XCTestCase {
let didStopLocationObservationValue = await didStopLocationUpdating.value
XCTAssertTrue(didStopLocationObservationValue)
}

func test_didTapNextEventBanner() async {
let store = await TestStore(
initialState: AppFeature.State(nextRideState: NextRideFeature.State(nextRide: Ride.mock1)),
reducer: { AppFeature() },
withDependencies: {
$0.continuousClock = TestClock()
}
)
store.exhaustivity = .off

// act
await store.send(.didTapNextEventBanner)

// assert
await store.receive(.map(.focusNextRide(Ride.mock1.coordinate)))
await store.receive(.set(\.$bottomSheetPosition, .relative(0.3)))
}
}

// MARK: Helper
Expand Down

0 comments on commit 2a41956

Please sign in to comment.