Skip to content

Commit 603ecc0

Browse files
committed
WIP
1 parent dca4778 commit 603ecc0

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

Tests/Tests/ViewTypes/NavigationSplitViewTests.swift

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import SwiftUI
22
import SwiftUIIntrospect
3-
import XCTest
3+
import Testing
44

5-
@available(iOS 16, tvOS 16, macOS 13, *)
65
@MainActor
7-
final class NavigationSplitViewTests: XCTestCase {
6+
@Suite
7+
struct NavigationSplitViewTests {
88
#if canImport(UIKit) && (os(iOS) || os(visionOS))
99
typealias PlatformNavigationSplitView = UISplitViewController
1010
#elseif canImport(UIKit) && os(tvOS)
@@ -13,17 +13,10 @@ final class NavigationSplitViewTests: XCTestCase {
1313
typealias PlatformNavigationSplitView = NSSplitView
1414
#endif
1515

16-
func testNavigationSplitView() throws {
17-
guard #available(iOS 16, tvOS 16, macOS 13, *) else {
18-
throw XCTSkip()
19-
}
20-
guard #unavailable(tvOS 18) else {
21-
throw XCTSkip()
22-
}
23-
24-
XCTAssertViewIntrospection(of: PlatformNavigationSplitView.self) { spies in
25-
let spy = spies[0]
26-
16+
@available(iOS 16, macOS 13, *)
17+
@available(tvOS, introduced: 16, obsoleted: 18)
18+
@Test func introspect() async throws {
19+
try await introspection(of: PlatformNavigationSplitView.self) { spy in
2720
NavigationSplitView {
2821
ZStack {
2922
Color.red
@@ -45,17 +38,10 @@ final class NavigationSplitViewTests: XCTestCase {
4538
}
4639
}
4740

48-
func testNavigationSplitViewAsAncestor() throws {
49-
guard #available(iOS 16, tvOS 16, macOS 13, *) else {
50-
throw XCTSkip()
51-
}
52-
guard #unavailable(tvOS 18) else {
53-
throw XCTSkip()
54-
}
55-
56-
XCTAssertViewIntrospection(of: PlatformNavigationSplitView.self) { spies in
57-
let spy = spies[0]
58-
41+
@available(iOS 16, macOS 13, *)
42+
@available(tvOS, introduced: 16, obsoleted: 18)
43+
@Test func introspectAsAncestor() async throws {
44+
try await introspection(of: PlatformNavigationSplitView.self) { spy in
5945
// NB: columnVisibility is explicitly set here for ancestor introspection to work, because initially on iPad the sidebar is hidden, so the introspection modifier isn't triggered until the user makes the sidebar appear. This is why ancestor introspection is discouraged for most situations and it's opt-in.
6046
NavigationSplitView(columnVisibility: .constant(.all)) {
6147
ZStack {

0 commit comments

Comments
 (0)