This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate KeyboardShortcut tests from Enzyme to RTL (#9405)
* Migrate tests from Enzyme to RTL * Fix languageHandler tests Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
- Loading branch information
Showing
5 changed files
with
1,078 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 34 additions & 77 deletions
111
test/components/views/settings/__snapshots__/KeyboardShortcut-test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,73 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`KeyboardShortcut doesn't render + if last 1`] = ` | ||
<KeyboardKey | ||
last={true} | ||
name="a" | ||
> | ||
<div> | ||
<kbd> | ||
a | ||
</kbd> | ||
</KeyboardKey> | ||
</div> | ||
`; | ||
|
||
exports[`KeyboardShortcut doesn't render same modifier twice 1`] = ` | ||
<KeyboardShortcut | ||
value={ | ||
Object { | ||
"ctrlOrCmdKey": true, | ||
"key": "a", | ||
"metaKey": true, | ||
} | ||
} | ||
> | ||
<div> | ||
<div | ||
className="mx_KeyboardShortcut" | ||
class="mx_KeyboardShortcut" | ||
> | ||
<KeyboardKey | ||
key="ctrlOrCmdKey" | ||
name="Control" | ||
> | ||
<kbd> | ||
Ctrl | ||
</kbd> | ||
+ | ||
</KeyboardKey> | ||
<KeyboardKey | ||
last={true} | ||
name="a" | ||
> | ||
<kbd> | ||
a | ||
</kbd> | ||
</KeyboardKey> | ||
<kbd> | ||
Ctrl | ||
</kbd> | ||
+ | ||
<kbd> | ||
a | ||
</kbd> | ||
</div> | ||
</KeyboardShortcut> | ||
</div> | ||
`; | ||
|
||
exports[`KeyboardShortcut doesn't render same modifier twice 2`] = ` | ||
<KeyboardShortcut | ||
value={ | ||
Object { | ||
"ctrlKey": true, | ||
"ctrlOrCmdKey": true, | ||
"key": "a", | ||
} | ||
} | ||
> | ||
<div> | ||
<div | ||
className="mx_KeyboardShortcut" | ||
class="mx_KeyboardShortcut" | ||
> | ||
<KeyboardKey | ||
key="ctrlOrCmdKey" | ||
name="Control" | ||
> | ||
<kbd> | ||
Ctrl | ||
</kbd> | ||
+ | ||
</KeyboardKey> | ||
<KeyboardKey | ||
last={true} | ||
name="a" | ||
> | ||
<kbd> | ||
a | ||
</kbd> | ||
</KeyboardKey> | ||
<kbd> | ||
Ctrl | ||
</kbd> | ||
+ | ||
<kbd> | ||
a | ||
</kbd> | ||
</div> | ||
</KeyboardShortcut> | ||
</div> | ||
`; | ||
|
||
exports[`KeyboardShortcut renders alternative key name 1`] = ` | ||
<KeyboardKey | ||
name="PageDown" | ||
> | ||
<div> | ||
<kbd> | ||
Page Down | ||
</kbd> | ||
+ | ||
</KeyboardKey> | ||
</div> | ||
`; | ||
|
||
exports[`KeyboardShortcut renders key icon 1`] = ` | ||
<KeyboardKey | ||
name="ArrowDown" | ||
> | ||
<div> | ||
<kbd> | ||
↓ | ||
</kbd> | ||
+ | ||
</KeyboardKey> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.