test(e2e): make the seeded account admin + cover admin nav pages
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
+3
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user