Skip to content

Commit

Permalink
Fix tests for tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Naumov committed May 2, 2023
1 parent 9f758d0 commit 06c60ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 4 additions & 6 deletions Sources/ViewInspector/SwiftUI/ColorPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,15 @@ extension ViewType.ColorPicker: SupplementaryChildrenLabelView { }

// MARK: - Custom Attributes

@available(iOS 14.0, macOS 11.0, *)
@available(tvOS, unavailable)
@available(iOS 14.0, tvOS 14.0, macOS 11.0, *)
public extension InspectableView where View == ViewType.ColorPicker {

func labelView() throws -> InspectableView<ViewType.ClassifiedView> {
return try View.supplementaryChildren(self).element(at: 0)
.asInspectableView(ofType: ViewType.ClassifiedView.self)
}

@available(tvOS 14.0, watchOS 7.0, *)
@available(watchOS 7.0, *)
func select(color: Color) throws {
try guardIsResponsive()
#if os(macOS)
Expand Down Expand Up @@ -80,8 +79,7 @@ public extension InspectableView where View == ViewType.ColorPicker {
#endif
}

@available(iOS 14.0, macOS 11.0, *)
@available(tvOS, unavailable)
@available(iOS 14.0, tvOS 14.0, macOS 11.0, *)
public extension ViewType.ColorPicker {
/**
A container for comparing colors in tests. FYI: Color.red != UIColor.red
Expand All @@ -101,7 +99,7 @@ public extension ViewType.ColorPicker {
#endif
}

@available(tvOS 14.0, watchOS 7.0, *)
@available(watchOS 7.0, *)
init(color: Color) {
#if os(macOS)
self.init(color: NSColor(color))
Expand Down
6 changes: 2 additions & 4 deletions Tests/ViewInspectorTests/SwiftUI/TreeViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import XCTest
import SwiftUI
@testable import ViewInspector

@available(iOS 13.0, macOS 10.15, *)
@available(tvOS, unavailable)
@available(iOS 13.0, tvOS 14.0, macOS 10.15, *)
final class TreeViewTests: XCTestCase {

@available(watchOS, deprecated: 7.0)
Expand Down Expand Up @@ -40,8 +39,7 @@ final class TreeViewTests: XCTestCase {

// MARK: - View Modifiers

@available(iOS 13.0, macOS 10.15, *)
@available(tvOS, unavailable)
@available(iOS 13.0, tvOS 14.0, macOS 10.15, *)
final class GlobalModifiersForTreeView: XCTestCase {

@available(watchOS, deprecated: 7.0)
Expand Down

0 comments on commit 06c60ae

Please sign in to comment.