fix: resolve 6 QA bugs in frontend admin panel (RCA-19)
Bug 1: Dashboard child route path "" → "dashboard" + redirect from / Bug 2: Test localStorage key "admin_token" → "cb_admin_token" Bug 3: Router setup check data.isSetUp → data.initialised Bug 4: Setup wizard button text to match test selectors Bug 5: loginViaAPI helper sets localStorage directly instead of hitting relay Bug 6: Login button disabled when fields are empty Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -107,7 +107,7 @@ test.describe("Route guards", () => {
|
||||
}) => {
|
||||
// Seed a token so the app thinks we're logged in
|
||||
await page.goto("/login");
|
||||
await page.evaluate(() => localStorage.setItem("admin_token", "fake-jwt"));
|
||||
await page.evaluate(() => localStorage.setItem("cb_admin_token", "fake-jwt"));
|
||||
|
||||
// Mock /admin/auth/me to return a valid user
|
||||
await page.route("**/admin/auth/me", (route) =>
|
||||
@@ -233,7 +233,7 @@ test.describe("Logout", () => {
|
||||
await expect(page).toHaveURL(/\/login/);
|
||||
|
||||
// Token should be gone
|
||||
const token = await page.evaluate(() => localStorage.getItem("admin_token"));
|
||||
const token = await page.evaluate(() => localStorage.getItem("cb_admin_token"));
|
||||
expect(token).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user