summaryrefslogtreecommitdiff
path: root/scripts/tui-golden.py
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-23 09:34:16 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-23 09:34:16 +0200
commit79b27457125dc2e259783359085021eea1d26e3a (patch)
treee5b733b642437d34d46ee34514b093daee52fcef /scripts/tui-golden.py
parent6159042d0cb3870e6a7c6f8d9a97e175d59e6f80 (diff)
downloadbokf-79b27457125dc2e259783359085021eea1d26e3a.tar.gz
bokf-79b27457125dc2e259783359085021eea1d26e3a.zip
tui: "Byt bolag" in the main menu
Reopens the org picker (cursor on the current org) and switches the running session: the org's name, role, current fiscal year and series are reloaded and the remembered list selections cleared. The context reload now clears the previous org's values first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts/tui-golden.py')
-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