diff --git a/Backpack-SwiftUI/Tests/Select/SelectTests.swift b/Backpack-SwiftUI/Tests/Select/SelectTests.swift index 9419b6123..75f0f4a84 100644 --- a/Backpack-SwiftUI/Tests/Select/SelectTests.swift +++ b/Backpack-SwiftUI/Tests/Select/SelectTests.swift @@ -29,4 +29,49 @@ class BPKSelectTests: XCTestCase { ) .frame(width: 300)) } + + func test_selectSecondItem() { + assertSnapshot(BPKSelect(placeholder: "Backpacks", + options: ["Patagonia", "Nike"], + selectedIndex: 1, + onSelectionChange: { _ in } + ) + .frame(width: 300)) + } + + func test_selectOutOfBoundsItem() { + assertSnapshot(BPKSelect(placeholder: "Backpacks", + options: ["Patagonia", "Nike"], + selectedIndex: 666, + onSelectionChange: { _ in } + ) + .frame(width: 300)) + } + + func test_emptyOptions() { + assertSnapshot(BPKSelect(placeholder: "Backpacks", + options: [], + selectedIndex: 0, + onSelectionChange: { _ in } + ) + .frame(width: 300)) + } + + func test_errorState() { + assertSnapshot(BPKSelect(placeholder: "Backpacks", + options: ["Error"], + selectedIndex: 0, + onSelectionChange: { _ in } + ).inputState(.error) + .frame(width: 300)) + } + + func test_disabledState() { + assertSnapshot(BPKSelect(placeholder: "Backpacks", + options: ["Disabled"], + selectedIndex: 0, + onSelectionChange: { _ in } + ).inputState(.disabled) + .frame(width: 300)) + } } diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.dark-mode.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.dark-mode.png new file mode 100644 index 000000000..3f9a44d61 Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.light-mode.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.light-mode.png new file mode 100644 index 000000000..62fdc12dc Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.rtl.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.rtl.png new file mode 100644 index 000000000..4af97b228 Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_disabledState.rtl.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.dark-mode.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.dark-mode.png new file mode 100644 index 000000000..02a56929f Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.light-mode.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.light-mode.png new file mode 100644 index 000000000..c001121eb Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.rtl.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.rtl.png new file mode 100644 index 000000000..28b7d0cb6 Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_emptyOptions.rtl.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.dark-mode.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.dark-mode.png new file mode 100644 index 000000000..02a56929f Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.light-mode.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.light-mode.png new file mode 100644 index 000000000..c001121eb Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.rtl.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.rtl.png new file mode 100644 index 000000000..28b7d0cb6 Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectOutOfBoundsItem.rtl.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.dark-mode.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.dark-mode.png new file mode 100644 index 000000000..71186df10 Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.light-mode.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.light-mode.png new file mode 100644 index 000000000..4f2521aa0 Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.rtl.png b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.rtl.png new file mode 100644 index 000000000..b32d5ff7d Binary files /dev/null and b/Backpack-SwiftUI/Tests/Select/__Snapshots__/SelectTests/test_selectSecondItem.rtl.png differ