Skip to content

Commit 0af53c9

Browse files
authored
Enable animation completion test for macOS (#498)
1 parent af23edc commit 0af53c9

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

Tests/OpenSwiftUICompatibilityTests/Animation/Animation/AnimationCompletionCompatibilityTests.swift

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@ import OpenSwiftUITestsSupport
77

88
@MainActor
99
struct AnimationCompletionCompatibilityTests {
10-
@Test(.disabled {
11-
#if os(macOS)
12-
// FIXME: macOS Animation is not supported yet
13-
true
14-
#else
15-
false
16-
#endif
17-
})
10+
@Test
1811
func logicalAndRemovedComplete() async throws {
1912
@MainActor
2013
enum Helper {
@@ -39,28 +32,30 @@ struct AnimationCompletionCompatibilityTests {
3932
} completion: {
4033
Helper.values.append(1)
4134
confirmation()
35+
if Helper.values.count == 2 {
36+
continuation.resume()
37+
}
4238
}
4339
withAnimation(animation, completionCriteria: .removed) {
4440
scale = 2.0
4541
} completion: {
4642
Helper.values.append(2)
4743
confirmation()
48-
continuation.resume()
44+
if Helper.values.count == 2 {
45+
continuation.resume()
46+
}
4947
}
5048
}
5149
}
5250
}
53-
// Sometimes CI will fail for this test
54-
await withKnownIssue(isIntermittent: true) {
55-
try await triggerLayoutWithWindow(expectedCount: 2) { confirmation, continuation in
56-
PlatformHostingController(
57-
rootView: ContentView(
58-
confirmation: confirmation,
59-
continuation: continuation
60-
)
51+
try await triggerLayoutWithWindow(expectedCount: 2) { confirmation, continuation in
52+
PlatformHostingController(
53+
rootView: ContentView(
54+
confirmation: confirmation,
55+
continuation: continuation
6156
)
62-
}
63-
#expect(Helper.values == [1, 2])
57+
)
6458
}
59+
#expect(Helper.values == [1, 2])
6560
}
6661
}

0 commit comments

Comments
 (0)