Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Tests/Tests/ViewTypes/ButtonTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 0 additions & 10 deletions Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
10 changes: 0 additions & 10 deletions Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
10 changes: 0 additions & 10 deletions Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
2 changes: 0 additions & 2 deletions Tests/Tests/ViewTypes/FullScreenCoverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
Expand Down
6 changes: 0 additions & 6 deletions Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
6 changes: 0 additions & 6 deletions Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
6 changes: 0 additions & 6 deletions Tests/Tests/ViewTypes/NavigationStackTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
}

Expand All @@ -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
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}

Expand All @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions Tests/Tests/ViewTypes/PageControlTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,19 +15,15 @@ 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")) {
Text("1").tag("1")
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")) {
Expand All @@ -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
Loading
Loading