Last active
October 7, 2021 23:53
-
-
Save edudnyk/eecde9c5c4803c134e5b3c60a5f62c17 to your computer and use it in GitHub Desktop.
ChangedThrice / DismissedOnce test case in SheeKit
This file contains 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 testItemChangedThriceDismissedOnce() { | |
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: 10) | |
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.sendTouchSequence([ | |
(location: CGPoint(x: bounds.maxX * 0.75, y: bounds.midY), globalLocation: nil, timestamp: Date()) | |
]) | |
viewTest.turnRunloop(times: 10) | |
XCTAssertEqual(dismissCounter, 1) | |
XCTAssertNil(presentedViewController) | |
UIView.setAnimationsEnabled(true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment