Skip to content

Commit

Permalink
add test to verify behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
mltbnz committed Jun 6, 2023
1 parent edb2f0c commit f6d0f06
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CriticalMapsKit/Tests/AppFeatureTests/AppFeatureCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,23 @@ final class AppFeatureTests: XCTestCase {
XCTAssertTrue(val)
}
}

func test_postLocation_shouldNotPostLocationWhenObserverModeIsEnabled() async {
var state = AppFeature.State()
state.settingsState.userSettings.isObservationModeEnabled = true

let store = TestStore(
initialState: state,
reducer: AppFeature()
)
store.dependencies.date = .init({ @Sendable in self.date() })

let location = ComposableCoreLocation.Location(
coordinate: .init(latitude: 11, longitude: 21),
timestamp: Date(timeIntervalSince1970: 2)
)
await store.send(.postLocation)
}
}

// MARK: Helper
Expand Down

0 comments on commit f6d0f06

Please sign in to comment.