From 833aee07d437bfb0136e76ace62070521585e144 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sat, 18 Jul 2026 02:52:54 +0200 Subject: [PATCH] test(e2e): make the seeded account admin + cover admin nav pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The E2E account is now admin (matching the real primary user), so the nav spec also drives scheduler/config/users/audit — exercising the render ternary's admin branches, which the upcoming PageShell refactor will restructure. --- frontend/e2e/README.md | 6 ++++-- frontend/e2e/nav.spec.ts | 5 +++-- scripts/e2e_seed.py | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/e2e/README.md b/frontend/e2e/README.md index f461999..bdb022d 100644 --- a/frontend/e2e/README.md +++ b/frontend/e2e/README.md @@ -30,8 +30,10 @@ once, sharing the session via `e2e/.auth/state.json` (git-ignored). ## Account & fixture -Tests run as a dedicated, **non-demo** account `e2e@siftlode.local` (never a real account), reset to -a deterministic baseline every run by [`scripts/e2e_seed.py`](../../scripts/e2e_seed.py) (run +Tests run as a dedicated, **non-demo admin** account `e2e@siftlode.local` (never a real account; +admin so the suite can reach the admin-only pages / render branches, matching the real primary +user), reset to a deterministic baseline every run by +[`scripts/e2e_seed.py`](../../scripts/e2e_seed.py) (run in-container so it reuses the app's models + argon2 hasher): the top-3 organic channels subscribed, one in-progress + one watched + one saved video, prefs pinned to `language: en`. Credentials come from `E2E_EMAIL` / `E2E_PASSWORD` (local-only defaults). Override the container name with diff --git a/frontend/e2e/nav.spec.ts b/frontend/e2e/nav.spec.ts index 9d8b37a..42d91e9 100644 --- a/frontend/e2e/nav.spec.ts +++ b/frontend/e2e/nav.spec.ts @@ -5,8 +5,9 @@ import { openApp } from "./helpers"; // Back steps through the history the app pushes. The render ternary + prop-drilled page state // this exercises is precisely what the module-registry refactor replaces. test.describe("page switching", () => { - // Core, non-admin modules that always exist for the E2E account. - const RAIL = ["channels", "playlists", "stats", "settings", "feed"]; + // Core + admin modules (the E2E account is an admin, matching the real primary user), so this + // also exercises the render ternary's admin branches (scheduler / config / users / audit). + const RAIL = ["channels", "playlists", "stats", "scheduler", "config", "users", "audit", "settings", "feed"]; test("each rail item activates its page", async ({ page }) => { await openApp(page); diff --git a/scripts/e2e_seed.py b/scripts/e2e_seed.py index 2c1d93d..f2ac599 100644 --- a/scripts/e2e_seed.py +++ b/scripts/e2e_seed.py @@ -58,7 +58,9 @@ def main() -> None: user.is_suspended = False user.is_demo = False user.google_sub = None - user.role = "user" + # Admin so the E2E can reach the admin-only pages (scheduler / config / users / audit) and + # thus the render ternary's admin branches — the primary real user (npeter83) is admin too. + user.role = "admin" user.display_name = "E2E Tester" user.preferences = {"language": "en"} db.commit()