Skip to content

Commit

Permalink
feat: LMN-29 Updated snapshots to cover all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Baldock committed Jul 20, 2023
1 parent f6cefbb commit 8f5b2e3
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions Backpack-SwiftUI/Tests/Select/SelectTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8f5b2e3

Please sign in to comment.