diff --git a/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/KeyboardVisualizerGroupViewSnapshotTests.swift b/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/KeyboardVisualizerGroupViewSnapshotTests.swift index 68b2e4a..87385f6 100644 --- a/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/KeyboardVisualizerGroupViewSnapshotTests.swift +++ b/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/KeyboardVisualizerGroupViewSnapshotTests.swift @@ -34,6 +34,30 @@ final class KeyboardVisualizerGroupViewSnapshotTests: XCTestCase { ) } + func testRendersPBTBlackCommandShiftKKeycaps() { + self.assertCommandShiftKSnapshot( + style: .pbt, + theme: .black, + named: "pbt-black-command-shift-k-keycaps" + ) + } + + func testRendersMinimalBlackCommandShiftKKeycaps() { + self.assertCommandShiftKSnapshot( + style: .minimal, + theme: .black, + named: "minimal-black-command-shift-k-keycaps" + ) + } + + func testRendersRetroBlackCommandShiftKKeycaps() { + self.assertCommandShiftKSnapshot( + style: .retro, + theme: .black, + named: "retro-black-command-shift-k-keycaps" + ) + } + func testRendersM0116StyleKeycap() { self.assertGroupSnapshot( style: .m0116, @@ -63,21 +87,11 @@ final class KeyboardVisualizerGroupViewSnapshotTests: XCTestCase { } func testRendersM0116StyleCommandShiftKKeycaps() { - let settings = self.settings(style: .m0116, theme: .white) - let items = KeycapItemFactory.modifierItems( - currentFlags: [], - releasedFlags: Self.commandShiftFlags, - palette: settings.palette - ) - + KeycapItemFactory.keycapItems( - keyCode: KeyboardKeyCode.k.rawValue, - legend: EventLegend(text: "K"), - modifierFlags: [], - isPressed: false, - palette: settings.palette + self.assertCommandShiftKSnapshot( + style: .m0116, + theme: .white, + named: "m0116-command-shift-k-keycaps" ) - - self.assertGroupSnapshot(style: .m0116, theme: .white, items: items, named: "m0116-command-shift-k-keycaps") } func testRendersAppleBlackEscapeKeycap() { @@ -128,6 +142,39 @@ private extension KeyboardVisualizerGroupViewSnapshotTests { ) } + func assertCommandShiftKSnapshot( + style: KeycapStyle, + theme: KeyboardVisualizerTheme, + named name: String, + file: StaticString = #filePath, + testName: String = #function, + line: UInt = #line + ) { + let settings = self.settings(style: style, theme: theme) + let items = KeycapItemFactory.modifierItems( + currentFlags: [], + releasedFlags: Self.commandShiftFlags, + palette: settings.palette + ) + + KeycapItemFactory.keycapItems( + keyCode: KeyboardKeyCode.k.rawValue, + legend: EventLegend(text: "K"), + modifierFlags: [], + isPressed: false, + palette: settings.palette + ) + + self.assertGroupSnapshot( + style: style, + theme: theme, + items: items, + named: name, + file: file, + testName: testName, + line: line + ) + } + func assertAppleBlackSnapshot( items: [KeycapItem], named name: String, diff --git a/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersMinimalBlackCommandShiftKKeycaps.minimal-black-command-shift-k-keycaps.png b/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersMinimalBlackCommandShiftKKeycaps.minimal-black-command-shift-k-keycaps.png new file mode 100644 index 0000000..7f9b6ec Binary files /dev/null and b/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersMinimalBlackCommandShiftKKeycaps.minimal-black-command-shift-k-keycaps.png differ diff --git a/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersPBTBlackCommandShiftKKeycaps.pbt-black-command-shift-k-keycaps.png b/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersPBTBlackCommandShiftKKeycaps.pbt-black-command-shift-k-keycaps.png new file mode 100644 index 0000000..10eed77 Binary files /dev/null and b/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersPBTBlackCommandShiftKKeycaps.pbt-black-command-shift-k-keycaps.png differ diff --git a/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersRetroBlackCommandShiftKKeycaps.retro-black-command-shift-k-keycaps.png b/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersRetroBlackCommandShiftKKeycaps.retro-black-command-shift-k-keycaps.png new file mode 100644 index 0000000..a4e2935 Binary files /dev/null and b/Apps/Keyty/Tests/KeytyTests/Features/Visualizers/Keyboard/Keycaps/__Snapshots__/KeyboardVisualizerGroupViewSnapshotTests/testRendersRetroBlackCommandShiftKKeycaps.retro-black-command-shift-k-keycaps.png differ