-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
Tests/OpenSwiftUICompatibilityTests/View/Modifier/AppearanceActionModifierTests.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// AppearanceActionModifierTests.swift | ||
// OpenSwiftUICompatibilityTests | ||
|
||
import Testing | ||
|
||
@MainActor | ||
struct AppearanceActionModifierTests { | ||
@Test | ||
func appear() async throws { | ||
struct ContentView: View { | ||
var confirmation: Confirmation | ||
|
||
var body: some View { | ||
AnyView(EmptyView()) | ||
.onAppear { | ||
confirmation() | ||
} | ||
} | ||
} | ||
|
||
await confirmation { confirmation in | ||
#if os(iOS) | ||
let vc = UIHostingController(rootView: ContentView(confirmation: confirmation)) | ||
vc.triggerLayout() | ||
workaroundIssue87(vc) | ||
#endif | ||
} | ||
} | ||
|
||
// TODO: Add disappear support and test case | ||
} |