summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/tui-golden.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/tui-golden.py b/scripts/tui-golden.py
index 4fee4df..9d6e9ca 100755
--- a/scripts/tui-golden.py
+++ b/scripts/tui-golden.py
@@ -61,6 +61,8 @@ KEYS = {
"f5": "\x1b[15~",
"f9": "\x1b[20~",
"f2": "\x1bOQ",
+ "backspace": "\x7f",
+ "tab": "\t",
}
# {org_name} {org_nr} {fy_label} {fy_start} {fy_end} are substituted at run
@@ -540,6 +542,50 @@ SCENARIOS = [
},
],
},
+ {
+ # Backspace in a freshly opened field edits the value; the next
+ # key must not replace everything.
+ "name": "form-edit-backspace",
+ "screen": "customers",
+ "steps": [
+ {
+ "keys": ["ctrln"],
+ "expect": ["Ny kund", "<UTKAST>"],
+ },
+ {
+ "keys": ["enter", "Bakstegskund", "enter"],
+ "expect": ["Bakstegskund"],
+ },
+ {
+ "keys": ["enter", "backspace", "x", "enter"],
+ "expect": ["Bakstegskunx"],
+ },
+ ],
+ },
+ {
+ # Typing on a header field edits it in place; 'q' is text in both
+ # header fields and cells, never "back".
+ "name": "voucher-form-typing",
+ "screen": "vouchers",
+ "steps": [
+ {
+ "keys": ["ctrln"],
+ "expect": ["Nytt verifikat", "Datum", "Konto"],
+ },
+ {
+ "keys": ["20260315", "enter"],
+ "expect": ["Nytt verifikat", "2026-03-15"],
+ },
+ {
+ "keys": ["down", "Qliro q", "enter"],
+ "expect": ["Nytt verifikat", "Qliro q"],
+ },
+ {
+ "keys": ["1930", "tab", "tab", "tab", "equity q"],
+ "expect": ["Nytt verifikat", "1930", "equity q"],
+ },
+ ],
+ },
]
# --------------------------------------------------------------------------