Stepper tests

This commit is contained in:
Lois Di Qual 2019-11-27 10:33:33 -08:00
parent 9883b78010
commit 3ecb78b60e
1 changed files with 22 additions and 0 deletions

View File

@ -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)
}
}