Last active
October 7, 2021 23:17
-
-
Save edudnyk/8d8618f8b9e1c553a9959e29cf7da3e7 to your computer and use it in GitHub Desktop.
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 { | |
var dismissCounter: Int = 0 | |
@ViewBuilder | |
override func initRootView() -> AnyView { | |
AnyView(ShowPartDetail { [weak self] in | |
guard let self = self else { return } | |
self.dismissCounter += 1 | |
}) | |
} | |
override func setUp() { | |
super.setUp() | |
UIView.setAnimationsEnabled(false) | |
} | |
override func tearDown() { | |
super.tearDown() | |
UIView.setAnimationsEnabled(true) | |
} | |
var presentedViewController: UIHostingController<AnyView>? { | |
window? | |
.rootViewController? | |
.presentedViewController as? UIHostingController<AnyView> | |
} | |
func test() { | |
viewTest?.loop() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment