Keybinding code unification #6 (#8042)

This commit is contained in:
Šimon Brandner 2022-03-14 14:25:51 +01:00 committed by GitHub
parent e725f14651
commit 8d13e238b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 462 additions and 351 deletions

View file

@ -0,0 +1,112 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`KeyboardShortcut doesn't render + if last 1`] = `
<KeyboardKey
last={true}
name="a"
>
<kbd>
a
</kbd>
</KeyboardKey>
`;
exports[`KeyboardShortcut doesn't render same modifier twice 1`] = `
<KeyboardShortcut
value={
Object {
"ctrlOrCmdKey": true,
"key": "a",
"metaKey": true,
}
}
>
<div>
<KeyboardKey
key="ctrlOrCmdKey"
name="Control"
>
<kbd>
missing translation: en|Ctrl
</kbd>
+
</KeyboardKey>
<KeyboardKey
last={true}
name="a"
>
<kbd>
a
</kbd>
</KeyboardKey>
</div>
</KeyboardShortcut>
`;
exports[`KeyboardShortcut doesn't render same modifier twice 2`] = `
<KeyboardShortcut
value={
Object {
"ctrlKey": true,
"ctrlOrCmdKey": true,
"key": "a",
}
}
>
<div>
<KeyboardKey
key="ctrlOrCmdKey"
name="Control"
>
<kbd>
missing translation: en|Ctrl
</kbd>
+
</KeyboardKey>
<KeyboardKey
last={true}
name="a"
>
<kbd>
a
</kbd>
</KeyboardKey>
</div>
</KeyboardShortcut>
`;
exports[`KeyboardShortcut renders alternative key name 1`] = `
<KeyboardKey
name="PageDown"
>
<kbd>
missing translation: en|Page Down
</kbd>
+
</KeyboardKey>
`;
exports[`KeyboardShortcut renders key icon 1`] = `
<KeyboardKey
name="ArrowDown"
>
<kbd>
</kbd>
+
</KeyboardKey>
`;