Feat: Adds example project / app
This commit is contained in:
@@ -2,6 +2,7 @@ import ComposableArchitecture
|
||||
import PressureEstimationsFeature
|
||||
import SharedModels
|
||||
import Testing
|
||||
import XCTest
|
||||
|
||||
struct RatedStaticPressureStateTests {
|
||||
|
||||
@@ -50,6 +51,34 @@ struct RatedStaticPressureStateTests {
|
||||
|
||||
}
|
||||
|
||||
final class RatedStaticPressureReducerTests: XCTestCase {
|
||||
|
||||
@MainActor
|
||||
func testBindingsSetSharedState() async {
|
||||
let store = TestStore(
|
||||
initialState: RatedStaticPressuresSection.State(
|
||||
staticPressures: Shared(RatedStaticPressures())
|
||||
)
|
||||
) {
|
||||
RatedStaticPressuresSection()
|
||||
}
|
||||
|
||||
await store.send(.binding(.set(\.maxPressure, nil))) {
|
||||
$0.maxPressure = nil
|
||||
$0.staticPressures.maximum = 0
|
||||
}
|
||||
await store.send(.binding(.set(\.minPressure, nil))) {
|
||||
$0.minPressure = nil
|
||||
$0.staticPressures.minimum = 0
|
||||
}
|
||||
await store.send(.binding(.set(\.ratedPressure, nil))) {
|
||||
$0.ratedPressure = nil
|
||||
$0.staticPressures.rated = 0
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
extension Tag {
|
||||
|
||||
@Tag static var ratedStaticPressuresSection: Self
|
||||
|
||||
Reference in New Issue
Block a user