Last active
October 7, 2021 23:56
-
-
Save edudnyk/0d2626b1f8fa65e613ab80535bb6dc0b to your computer and use it in GitHub Desktop.
ChangedThrice / DismissedTwice test case in SheeKit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class SheeTestCase: ViewTestCase { | |
... | |
func testItemChangedThriceDismissedTwice() { | |
guard let viewTest = viewTest else { | |
XCTFail("No view to test.") | |
return | |
} | |
let bounds = UIScreen.main.bounds | |
viewTest.sendTouchSequence([ | |
(location: CGPoint(x: bounds.maxX * 0.25, y: bounds.midY), globalLocation: nil, timestamp: Date()) | |
]) | |
viewTest.turnRunloop(times: 20) | |
guard let _ = presentedViewController else { | |
XCTFail("No presented view to test.") | |
return | |
} | |
viewTest.sendTouchSequence([ | |
(location: CGPoint(x: bounds.maxX * 0.75, y: bounds.midY), globalLocation: nil, timestamp: Date()) | |
]) | |
viewTest.turnRunloop(times: 10) | |
viewTest.sendTouchSequence([ | |
(location: CGPoint(x: bounds.maxX * 0.75, y: bounds.midY), globalLocation: nil, timestamp: Date()) | |
]) | |
viewTest.turnRunloop(times: 10) | |
XCTAssertEqual(dismissCounter, 2) | |
XCTAssertNil(presentedViewController) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment