summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/tui-golden.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/tui-golden.py b/scripts/tui-golden.py
index 71e1273..0dfde5f 100755
--- a/scripts/tui-golden.py
+++ b/scripts/tui-golden.py
@@ -41,6 +41,8 @@ from pathlib import Path
ORG_NAME = "Test AB"
ORG_NR = "5560123456"
+ORG2_NAME = "Andra AB"
+ORG2_NR = "5560654321"
DOWNLOAD_PATH = f"/tmp/bokf-golden-dl-{os.getpid()}.txt"
KEYS = {
@@ -618,6 +620,32 @@ SCENARIOS = [
],
},
{
+ # "Byt bolag" in the main menu switches org and its context (name,
+ # year); Esc in the picker keeps the current org.
+ "name": "switch-org",
+ "screen": "dashboard",
+ "expect": ["{org_name}", "Byt bolag", "Logga ut / avsluta"],
+ "steps": [
+ {
+ "keys": ["g", "byt", "enter", "enter"],
+ "expect": ["Välj organisation att representera",
+ "Andra AB"],
+ },
+ {
+ "keys": ["esc"],
+ "expect": ["{org_name} |", "Byt bolag"],
+ },
+ {
+ "keys": ["enter", "down", "enter"],
+ "expect": ["Andra AB |", "Byt bolag"],
+ },
+ {
+ "keys": ["1"],
+ "expect": ["sorterade på nummer", "Nytt verifikat"],
+ },
+ ],
+ },
+ {
# Backspace in a freshly opened field edits the value; the next
# key must not replace everything.
"name": "form-edit-backspace",
@@ -1207,6 +1235,11 @@ def setup_rig(repo, tmp, env):
"tax_table": 30,
"tax_column": 1,
"email": "test@example.com"})], env)
+ # a second org for "Byt bolag"; the TUI always starts in the first
+ run_checked([str(bind / "bokfctl"), "--socket", str(sock),
+ "--user", "admin", "--password", env["BOKFD_PASSWORD"],
+ "org.create",
+ json.dumps({"name": ORG2_NAME, "org_nr": ORG2_NR})], env)
return daemon, sock, org_id, fy