Skip to content

Commit

Permalink
Merge pull request #167 from adevinta/feature/component/button-presse…
Browse files Browse the repository at this point in the history
…d-snapshots

[Component] Add button snapshot tests for pressed state.
  • Loading branch information
janniklasfreundt authored Jun 7, 2023
2 parents 2e8e3ea + 5d718e7 commit 87df024
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions core/Sources/Components/Button/View/ButtonUIViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ final class ButtonUIViewTests: UIKitComponentTestCase {
}
}
}

func test_pressed() throws {
for variant in variants {
for intent in intents {
let button = ButtonUIView(
theme: theme,
text: "Pressed button",
state: .enabled,
variant: variant,
intentColor: intent
)
button.isPressed = true

let identifier = "\(variant.identifier)-\(intent.identifier)"
assertSnapshotInDarkAndLight(matching: button, named: identifier)
}
}
}
}

// MARK: - Private extension
Expand Down

0 comments on commit 87df024

Please sign in to comment.