|
1 |
| -#if !os(macOS) |
2 |
| -import SwiftUI |
3 |
| -import SwiftUIIntrospect |
4 |
| -import XCTest |
5 |
| - |
6 |
| -final class SheetTests: XCTestCase { |
7 |
| - #if os(iOS) |
8 |
| - func testSheet() throws { |
9 |
| - XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in |
10 |
| - let spy0 = spies[0] |
11 |
| - |
12 |
| - Text("Root") |
13 |
| - .sheet(isPresented: .constant(true)) { |
14 |
| - Text("Sheet") |
15 |
| - .introspect( |
16 |
| - .sheet, |
17 |
| - on: .iOS(.v13, .v14, .v15, .v16, .v17), .tvOS(.v13, .v14, .v15, .v16, .v17), |
18 |
| - customize: spy0 |
19 |
| - ) |
20 |
| - } |
21 |
| - } |
22 |
| - } |
23 |
| - |
24 |
| - func testSheetAsSheetPresentationController() throws { |
25 |
| - guard #available(iOS 15, tvOS 15, *) else { |
26 |
| - throw XCTSkip() |
27 |
| - } |
28 |
| - |
29 |
| - XCTAssertViewIntrospection(of: UISheetPresentationController.self) { spies in |
30 |
| - let spy0 = spies[0] |
31 |
| - |
32 |
| - Text("Root") |
33 |
| - .sheet(isPresented: .constant(true)) { |
34 |
| - Text("Sheet") |
35 |
| - .introspect( |
36 |
| - .sheet, |
37 |
| - on: .iOS(.v15, .v16, .v17), |
38 |
| - customize: spy0 |
39 |
| - ) |
40 |
| - } |
41 |
| - } |
42 |
| - } |
43 |
| - #elseif os(tvOS) |
44 |
| - func testSheet() throws { |
45 |
| - throw XCTSkip("FIXME: this test doesn't pass for some reason, even though introspection works in the Showcase app") |
46 |
| - |
47 |
| - XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in |
48 |
| - let spy0 = spies[0] |
49 |
| - |
50 |
| - Text("Root") |
51 |
| - .sheet(isPresented: .constant(true)) { |
52 |
| - Text("Content") |
53 |
| - .introspect( |
54 |
| - .sheet, |
55 |
| - on: .tvOS(.v13, .v14, .v15, .v16, .v17), |
56 |
| - customize: spy0 |
57 |
| - ) |
58 |
| - } |
59 |
| - } |
60 |
| - } |
61 |
| - #elseif os(visionOS) |
62 |
| - func testSheet() throws { |
63 |
| - XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in |
64 |
| - let spy0 = spies[0] |
65 |
| - |
66 |
| - Text("Root") |
67 |
| - .sheet(isPresented: .constant(true)) { |
68 |
| - Text("Sheet") |
69 |
| - .introspect( |
70 |
| - .sheet, |
71 |
| - on: .visionOS(.v1), |
72 |
| - customize: spy0 |
73 |
| - ) |
74 |
| - } |
75 |
| - } |
76 |
| - } |
77 |
| - #endif |
78 |
| -} |
79 |
| -#endif |
| 1 | +//#if !os(macOS) |
| 2 | +//import SwiftUI |
| 3 | +//import SwiftUIIntrospect |
| 4 | +//import XCTest |
| 5 | +// |
| 6 | +//final class SheetTests: XCTestCase { |
| 7 | +// #if os(iOS) |
| 8 | +// func testSheet() throws { |
| 9 | +// XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in |
| 10 | +// let spy0 = spies[0] |
| 11 | +// |
| 12 | +// Text("Root") |
| 13 | +// .sheet(isPresented: .constant(true)) { |
| 14 | +// Text("Sheet") |
| 15 | +// .introspect( |
| 16 | +// .sheet, |
| 17 | +// on: .iOS(.v13, .v14, .v15, .v16, .v17), .tvOS(.v13, .v14, .v15, .v16, .v17), |
| 18 | +// customize: spy0 |
| 19 | +// ) |
| 20 | +// } |
| 21 | +// } |
| 22 | +// } |
| 23 | +// |
| 24 | +// func testSheetAsSheetPresentationController() throws { |
| 25 | +// guard #available(iOS 15, tvOS 15, *) else { |
| 26 | +// throw XCTSkip() |
| 27 | +// } |
| 28 | +// |
| 29 | +// XCTAssertViewIntrospection(of: UISheetPresentationController.self) { spies in |
| 30 | +// let spy0 = spies[0] |
| 31 | +// |
| 32 | +// Text("Root") |
| 33 | +// .sheet(isPresented: .constant(true)) { |
| 34 | +// Text("Sheet") |
| 35 | +// .introspect( |
| 36 | +// .sheet, |
| 37 | +// on: .iOS(.v15, .v16, .v17), |
| 38 | +// customize: spy0 |
| 39 | +// ) |
| 40 | +// } |
| 41 | +// } |
| 42 | +// } |
| 43 | +// #elseif os(tvOS) |
| 44 | +// func testSheet() throws { |
| 45 | +// throw XCTSkip("FIXME: this test doesn't pass for some reason, even though introspection works in the Showcase app") |
| 46 | +// |
| 47 | +// XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in |
| 48 | +// let spy0 = spies[0] |
| 49 | +// |
| 50 | +// Text("Root") |
| 51 | +// .sheet(isPresented: .constant(true)) { |
| 52 | +// Text("Content") |
| 53 | +// .introspect( |
| 54 | +// .sheet, |
| 55 | +// on: .tvOS(.v13, .v14, .v15, .v16, .v17), |
| 56 | +// customize: spy0 |
| 57 | +// ) |
| 58 | +// } |
| 59 | +// } |
| 60 | +// } |
| 61 | +// #elseif os(visionOS) |
| 62 | +// func testSheet() throws { |
| 63 | +// XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in |
| 64 | +// let spy0 = spies[0] |
| 65 | +// |
| 66 | +// Text("Root") |
| 67 | +// .sheet(isPresented: .constant(true)) { |
| 68 | +// Text("Sheet") |
| 69 | +// .introspect( |
| 70 | +// .sheet, |
| 71 | +// on: .visionOS(.v1), |
| 72 | +// customize: spy0 |
| 73 | +// ) |
| 74 | +// } |
| 75 | +// } |
| 76 | +// } |
| 77 | +// #endif |
| 78 | +//} |
| 79 | +//#endif |
0 commit comments