Skip to content

Commit c32ed7f

Browse files
committed
Update tests.
1 parent f2f6498 commit c32ed7f

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

tests/acceptance/lute_test_client.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,24 @@ def fill_reading_bulk_edit_form(self, updates=None):
366366

367367
def press_hotkey(self, hotkey):
368368
"Send a hotkey."
369+
key_to_code_map = {
370+
"1": "Digit1",
371+
"2": "Digit2",
372+
"3": "Digit3",
373+
"4": "Digit4",
374+
"5": "Digit5",
375+
"arrowdown": "ArrowDown",
376+
"arrowup": "ArrowUp",
377+
"h": "KeyH",
378+
"i": "KeyI",
379+
"m": "KeyM",
380+
"w": "KeyW",
381+
}
382+
if hotkey not in key_to_code_map:
383+
raise RuntimeError(f"Missing {hotkey} in acceptance test map")
369384
event_parts = [
370385
"type: 'keydown'",
371-
f"key: '{hotkey.lower()}'",
386+
f"code: '{key_to_code_map[hotkey]}'",
372387
]
373388
if hotkey in ["C", "T"]:
374389
event_parts.append("shiftKey: true")

tests/unit/settings/test_current.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ def test_hotkey_strings_mapped_to_name(app_context):
2323
refresh_global_settings(db.session)
2424
hotkey_names = current_hotkeys.values()
2525
assert "hotkey_Status5" in hotkey_names, "this is set by default"
26-
assert current_hotkeys["5"] == "hotkey_Status5", "mapped"
26+
assert current_hotkeys["Digit5"] == "hotkey_Status5", "mapped"
2727
assert "" not in current_hotkeys, "No blank keyboard shortcuts"

0 commit comments

Comments
 (0)