Stepper tests
This commit is contained in:
parent
9883b78010
commit
3ecb78b60e
|
@ -92,6 +92,18 @@ private struct SliderTestView: View {
|
|||
}
|
||||
}
|
||||
|
||||
private struct StepperTestView: View {
|
||||
let spy: () -> Void
|
||||
var body: some View {
|
||||
Stepper(onIncrement: {}, onDecrement: {}) {
|
||||
Text("Stepper")
|
||||
}
|
||||
.introspectStepper { stepper in
|
||||
self.spy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class IntrospectTests: XCTestCase {
|
||||
func testNavigation() {
|
||||
|
||||
|
@ -156,4 +168,14 @@ class IntrospectTests: XCTestCase {
|
|||
TestUtils.present(view: view)
|
||||
wait(for: [expectation], timeout: 1)
|
||||
}
|
||||
|
||||
func testStepper() {
|
||||
|
||||
let expectation = XCTestExpectation()
|
||||
let view = StepperTestView(spy: {
|
||||
expectation.fulfill()
|
||||
})
|
||||
TestUtils.present(view: view)
|
||||
wait(for: [expectation], timeout: 1)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue