feat: Reverts static pressure.
This commit is contained in:
@@ -173,6 +173,39 @@ final class FlaggedMeasurementListReducerTests: XCTestCase {
|
||||
await store.finish()
|
||||
|
||||
}
|
||||
|
||||
// @MainActor
|
||||
// func testBindingsSetSharedState() async {
|
||||
// let store = TestStore(
|
||||
// initialState: FlaggedMeasurementsList.State(
|
||||
// sharedSettings: Shared(SharedPressureEstimationState(
|
||||
// budgets: nil,
|
||||
// equipmentMeasurement: .mock(type: .airHandler),
|
||||
// equipmentMetadata: .init(
|
||||
// coolingCapacity: .three,
|
||||
// fanType: .constantSpeed,
|
||||
// ratedStaticPressures: .init()
|
||||
// )
|
||||
// ))
|
||||
// )
|
||||
// ) {
|
||||
// FlaggedMeasurementsList()
|
||||
// }
|
||||
//
|
||||
// await store.send(.binding(.set(\.maxStaticPressure, nil))) {
|
||||
// $0.maxStaticPressure = nil
|
||||
// $0.sharedSettings.ratedStaticPressures.maximum = 0
|
||||
// }
|
||||
// await store.send(.binding(.set(\.minStaticPressure, nil))) {
|
||||
// $0.minStaticPressure = nil
|
||||
// $0.sharedSettings.ratedStaticPressures.minimum = 0
|
||||
// }
|
||||
// await store.send(.binding(.set(\.ratedStaticPressure, nil))) {
|
||||
// $0.ratedStaticPressure = nil
|
||||
// $0.sharedSettings.ratedStaticPressures.rated = 0
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
extension Tag {
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
import ComposableArchitecture
|
||||
import PressureEstimationsFeature
|
||||
import SharedModels
|
||||
import Testing
|
||||
import XCTest
|
||||
|
||||
struct RatedStaticPressureStateTests {
|
||||
|
||||
@Test(
|
||||
"Rated static pressure validation",
|
||||
.tags(.ratedStaticPressuresSection)
|
||||
)
|
||||
func validation() {
|
||||
var state = RatedStaticPressuresSection.State(
|
||||
staticPressures: Shared(RatedStaticPressures())
|
||||
)
|
||||
#expect(state.isValid)
|
||||
|
||||
state.maxPressure = nil
|
||||
#expect(!state.isValid)
|
||||
|
||||
state.maxPressure = 1
|
||||
state.minPressure = nil
|
||||
#expect(!state.isValid)
|
||||
|
||||
state.minPressure = 1
|
||||
state.ratedPressure = nil
|
||||
#expect(!state.isValid)
|
||||
|
||||
state.ratedPressure = 1
|
||||
#expect(state.isValid)
|
||||
}
|
||||
|
||||
@Test(
|
||||
"Focused field label",
|
||||
.tags(.ratedStaticPressuresSection),
|
||||
arguments: RatedStaticPressuresSection.State.FocusedField.allCases
|
||||
)
|
||||
func label(field: RatedStaticPressuresSection.State.FocusedField) {
|
||||
#expect(field.label == "\(field.rawValue.capitalized)")
|
||||
}
|
||||
|
||||
@Test(
|
||||
"Focused field prompt",
|
||||
.tags(.ratedStaticPressuresSection),
|
||||
arguments: RatedStaticPressuresSection.State.FocusedField.allCases
|
||||
)
|
||||
func prompt(field: RatedStaticPressuresSection.State.FocusedField) {
|
||||
#expect(field.prompt == "\(field.rawValue.capitalized) Pressure")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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