diff --git a/Tests/Tests/ViewTypes/ButtonTests.swift b/Tests/Tests/ViewTypes/ButtonTests.swift index f753ab8d..995ebcb6 100644 --- a/Tests/Tests/ViewTypes/ButtonTests.swift +++ b/Tests/Tests/ViewTypes/ButtonTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct ButtonTests { - #if canImport(AppKit) typealias PlatformButton = NSButton - #endif @available(macOS, introduced: 10.15, obsoleted: 26.0) @Test func introspectButtonsBeforeMacOS26() async throws { diff --git a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift index 845bb16a..045a0f42 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct DatePickerWithFieldStyleTests { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithFieldStyle = NSDatePicker - #endif @Test func introspect() async throws { let date1 = Date(timeIntervalSince1970: 0) @@ -19,30 +17,22 @@ struct DatePickerWithFieldStyleTests { VStack { DatePicker("", selection: .constant(date1)) .datePickerStyle(.field) - #if os(macOS) .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) - #endif .cornerRadius(8) DatePicker("", selection: .constant(date2)) .datePickerStyle(.field) - #if os(macOS) .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) - #endif .cornerRadius(8) DatePicker("", selection: .constant(date3)) .datePickerStyle(.field) - #if os(macOS) .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) - #endif } } - #if canImport(AppKit) && !targetEnvironment(macCatalyst) #expect(entity1.dateValue == date1) #expect(entity2.dateValue == date2) #expect(entity3.dateValue == date3) - #endif } } #endif diff --git a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift index 4e8083d2..766eebbf 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift @@ -5,9 +5,7 @@ import Testing @MainActor @Suite struct DatePickerWithStepperFieldStyleTests { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithStepperFieldStyle = NSDatePicker - #endif @Test func introspect() async throws { let date1 = Date(timeIntervalSince1970: 0) @@ -18,30 +16,22 @@ import Testing VStack { DatePicker("", selection: .constant(date1)) .datePickerStyle(.stepperField) - #if os(macOS) .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) - #endif .cornerRadius(8) DatePicker("", selection: .constant(date2)) .datePickerStyle(.stepperField) - #if os(macOS) .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) - #endif .cornerRadius(8) DatePicker("", selection: .constant(date3)) .datePickerStyle(.stepperField) - #if os(macOS) .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) - #endif } } - #if canImport(AppKit) && !targetEnvironment(macCatalyst) #expect(entity1.dateValue == date1) #expect(entity2.dateValue == date2) #expect(entity3.dateValue == date3) - #endif } } #endif diff --git a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift index 549350cb..861365d5 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct DatePickerWithWheelStyleTests { - #if canImport(UIKit) typealias PlatformDatePickerWithWheelStyle = UIDatePicker - #endif @Test func introspect() async throws { let date1 = Date(timeIntervalSince1970: 0) @@ -19,30 +17,22 @@ struct DatePickerWithWheelStyleTests { VStack { DatePicker("", selection: .constant(date1)) .datePickerStyle(.wheel) - #if os(iOS) || os(visionOS) .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) - #endif .cornerRadius(8) DatePicker("", selection: .constant(date2)) .datePickerStyle(.wheel) - #if os(iOS) || os(visionOS) .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) - #endif .cornerRadius(8) DatePicker("", selection: .constant(date3)) .datePickerStyle(.wheel) - #if os(iOS) || os(visionOS) .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) - #endif } } - #if canImport(UIKit) #expect(entity1.date == date1) #expect(entity2.date == date2) #expect(entity3.date == date3) - #endif } } #endif diff --git a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift index 08845413..89c84172 100644 --- a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift +++ b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift @@ -11,13 +11,11 @@ struct FullScreenCoverTests { Text("Root") .fullScreenCover(isPresented: .constant(true)) { Text("Content") - #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .fullScreenCover, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy ) - #endif } } } diff --git a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift index b9128281..41fb62f2 100644 --- a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct ListWithBorderedStyleTests { - #if canImport(AppKit) typealias PlatformListWithBorderedStyle = NSTableView - #endif @available(macOS 12, *) @Test func introspect() async throws { @@ -18,15 +16,11 @@ struct ListWithBorderedStyleTests { Text("Item 1") } .listStyle(.bordered) - #if os(macOS) .introspect(.list(style: .bordered), on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) - #endif List { Text("Item 1") - #if os(macOS) .introspect(.list(style: .bordered), on: .macOS(.v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) - #endif } .listStyle(.bordered) } diff --git a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift index 3a9179df..277b2cc9 100644 --- a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct ListWithGroupedStyleTests { - #if canImport(UIKit) typealias PlatformListWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView - #endif @Test func introspect() async throws { let (entity1, entity2) = try await introspection(of: PlatformListWithGroupedStyle.self) { spy1, spy2 in @@ -17,17 +15,13 @@ struct ListWithGroupedStyleTests { Text("Item 1") } .listStyle(.grouped) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.list(style: .grouped), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) .introspect(.list(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) - #endif List { Text("Item 1") - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.list(style: .grouped), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor, customize: spy2) .introspect(.list(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) - #endif } .listStyle(.grouped) } diff --git a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift index 7ce34b43..69dbcffd 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct ListWithInsetGroupedStyleTests { - #if canImport(UIKit) typealias PlatformListWithInsetGroupedStyle = UIScrollView // covers both UITableView and UICollectionView - #endif @Test func introspect() async throws { let (entity1, entity2) = try await introspection(of: PlatformListWithInsetGroupedStyle.self) { spy1, spy2 in @@ -17,17 +15,13 @@ struct ListWithInsetGroupedStyleTests { Text("Item 1") } .listStyle(.insetGrouped) - #if os(iOS) || os(visionOS) .introspect(.list(style: .insetGrouped), on: .iOS(.v14, .v15), customize: spy1) .introspect(.list(style: .insetGrouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) - #endif List { Text("Item 1") - #if os(iOS) || os(visionOS) .introspect(.list(style: .insetGrouped), on: .iOS(.v14, .v15), scope: .ancestor, customize: spy2) .introspect(.list(style: .insetGrouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) - #endif } .listStyle(.insetGrouped) } diff --git a/Tests/Tests/ViewTypes/NavigationStackTests.swift b/Tests/Tests/ViewTypes/NavigationStackTests.swift index de35b763..43098cdf 100644 --- a/Tests/Tests/ViewTypes/NavigationStackTests.swift +++ b/Tests/Tests/ViewTypes/NavigationStackTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct NavigationStackTests { - #if canImport(UIKit) typealias PlatformNavigationStack = UINavigationController - #endif @available(iOS 16, tvOS 16, *) @Test func introspect() async throws { @@ -19,9 +17,7 @@ struct NavigationStackTests { Text("Something") } } - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.navigationStack, on: .iOS(.v16, .v17, .v18, .v26), .tvOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) - #endif } } @@ -32,9 +28,7 @@ struct NavigationStackTests { ZStack { Color.red Text("Something") - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.navigationStack, on: .iOS(.v16, .v17, .v18, .v26), .tvOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy) - #endif } } } diff --git a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift index 674c3d56..96e1d363 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct NavigationViewWithStackStyleTests { - #if canImport(UIKit) typealias PlatformNavigationViewWithStackStyle = UINavigationController - #endif @Test func introspect() async throws { try await introspection(of: PlatformNavigationViewWithStackStyle.self) { spy in @@ -19,9 +17,7 @@ struct NavigationViewWithStackStyleTests { } } .navigationViewStyle(.stack) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.navigationView(style: .stack), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) - #endif } } @@ -31,9 +27,7 @@ struct NavigationViewWithStackStyleTests { ZStack { Color.red Text("Something") - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.navigationView(style: .stack), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy) - #endif } } .navigationViewStyle(.stack) diff --git a/Tests/Tests/ViewTypes/PageControlTests.swift b/Tests/Tests/ViewTypes/PageControlTests.swift index c9df6849..b654176d 100644 --- a/Tests/Tests/ViewTypes/PageControlTests.swift +++ b/Tests/Tests/ViewTypes/PageControlTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct PageControlTests { - #if canImport(UIKit) typealias PlatformPageControl = UIPageControl - #endif @Test func introspect() async throws { try await introspection(of: PlatformPageControl.self) { spy in @@ -17,9 +15,7 @@ struct PageControlTests { Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue) } .tabViewStyle(.page(indexDisplayMode: .always)) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.pageControl, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) - #endif } } } diff --git a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift index 2fdc2115..38d945eb 100644 --- a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct PickerWithMenuStyleTests { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformPickerWithMenuStyle = NSPopUpButton - #endif @Test func introspect() async throws { let (entity1, entity2, entity3) = try await introspection(of: PlatformPickerWithMenuStyle.self) { spy1, spy2, spy3 in @@ -17,9 +15,7 @@ struct PickerWithMenuStyleTests { Text("1").tag("1") } .pickerStyle(.menu) - #if os(macOS) .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) - #endif .cornerRadius(8) Picker("Pick", selection: .constant("1")) { @@ -27,9 +23,7 @@ struct PickerWithMenuStyleTests { Text("2").tag("2") } .pickerStyle(.menu) - #if os(macOS) .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) - #endif .cornerRadius(8) Picker("Pick", selection: .constant("1")) { @@ -38,16 +32,12 @@ struct PickerWithMenuStyleTests { Text("3").tag("3") } .pickerStyle(.menu) - #if os(macOS) .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) - #endif } } - #if canImport(AppKit) && !targetEnvironment(macCatalyst) #expect(entity1.numberOfItems == 1) #expect(entity2.numberOfItems == 2) #expect(entity3.numberOfItems == 3) - #endif } } #endif diff --git a/Tests/Tests/ViewTypes/SearchFieldTests.swift b/Tests/Tests/ViewTypes/SearchFieldTests.swift index 80b31741..4ebd7eb2 100644 --- a/Tests/Tests/ViewTypes/SearchFieldTests.swift +++ b/Tests/Tests/ViewTypes/SearchFieldTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct SearchFieldTests { - #if canImport(UIKit) typealias PlatformSearchField = UISearchBar - #endif @available(iOS 15, tvOS 15, *) @Test(.`disabled on iOS 26+ except for iPad`()) @@ -19,9 +17,7 @@ struct SearchFieldTests { .searchable(text: .constant("")) } .navigationViewStyle(.stack) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.searchField, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) - #endif } } @@ -35,9 +31,7 @@ struct SearchFieldTests { } .navigationViewStyle(.stack) } - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.searchField, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) - #endif } } @@ -48,9 +42,7 @@ struct SearchFieldTests { NavigationView { Text("Customized") .searchable(text: .constant("")) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.searchField, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy) - #endif } .navigationViewStyle(.stack) } @@ -63,9 +55,7 @@ struct SearchFieldTests { NavigationView { Text("Customized") .searchable(text: .constant("")) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.searchField, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy) - #endif } .navigationViewStyle(.stack) } @@ -81,9 +71,7 @@ struct SearchFieldTests { .searchable(text: .constant("")) } .navigationViewStyle(DoubleColumnNavigationViewStyle()) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.searchField, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) - #endif #if os(iOS) // NB: this is necessary for introspection to work, because on iPad the search field is in the sidebar, which is initially hidden. .introspect(.navigationView(style: .columns), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { @@ -102,9 +90,7 @@ struct SearchFieldTests { .searchable(text: .constant("")) } .navigationViewStyle(DoubleColumnNavigationViewStyle()) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.searchField, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) - #endif #if os(iOS) // NB: this is necessary for introspection to work, because on iPad the search field is in the sidebar, which is initially hidden. .introspect(.navigationView(style: .columns), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { @@ -122,9 +108,7 @@ struct SearchFieldTests { NavigationView { Text("Customized") .searchable(text: .constant("")) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.searchField, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy) - #endif } .navigationViewStyle(DoubleColumnNavigationViewStyle()) #if os(iOS) @@ -143,9 +127,7 @@ struct SearchFieldTests { NavigationView { Text("Customized") .searchable(text: .constant("")) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.searchField, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy) - #endif } .navigationViewStyle(DoubleColumnNavigationViewStyle()) #if os(iOS) diff --git a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift index cf0ee236..ef7a2b6c 100644 --- a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift +++ b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift @@ -6,9 +6,7 @@ import Testing @MainActor @Suite struct TabViewWithPageStyleTests { - #if canImport(UIKit) typealias PlatformTabViewWithPageStyle = UICollectionView - #endif @Test func introspect() async throws { try await introspection(of: PlatformTabViewWithPageStyle.self) { spy in @@ -17,9 +15,7 @@ struct TabViewWithPageStyleTests { Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue) } .tabViewStyle(.page) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.tabView(style: .page), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) - #endif } } @@ -27,9 +23,7 @@ struct TabViewWithPageStyleTests { try await introspection(of: PlatformTabViewWithPageStyle.self) { spy in TabView { Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red) - #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.tabView(style: .page), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy) - #endif Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue) } .tabViewStyle(.page) diff --git a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift index 70347d7f..68562980 100644 --- a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift @@ -6,37 +6,27 @@ import Testing @MainActor @Suite struct ToggleWithCheckboxStyleTests { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithCheckboxStyle = NSButton - #endif @Test func introspect() async throws { let (entity1, entity2, entity3) = try await introspection(of: PlatformToggleWithCheckboxStyle.self) { spy1, spy2, spy3 in VStack { Toggle("", isOn: .constant(true)) .toggleStyle(.checkbox) - #if os(macOS) .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) - #endif Toggle("", isOn: .constant(false)) .toggleStyle(.checkbox) - #if os(macOS) .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) - #endif Toggle("", isOn: .constant(true)) .toggleStyle(.checkbox) - #if os(macOS) .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) - #endif } } - #if canImport(AppKit) && !targetEnvironment(macCatalyst) #expect(entity1.state == .on) #expect(entity2.state == .off) #expect(entity3.state == .on) - #endif } } #endif diff --git a/Tests/Tests/ViewTypes/WebViewTests.swift b/Tests/Tests/ViewTypes/WebViewTests.swift index 70ab59b8..6bb80869 100644 --- a/Tests/Tests/ViewTypes/WebViewTests.swift +++ b/Tests/Tests/ViewTypes/WebViewTests.swift @@ -1,4 +1,4 @@ -#if compiler(>=6.2) && canImport(WebKit) +#if canImport(WebKit) import SwiftUI import SwiftUIIntrospect import Testing