fix(demo): boot to dashboard, sample-data notice, robust mobile editor icon (#464)

The demo signs in as an admin on load (no login/change-password screen; /login and /change-password bounce to the dashboard), authEnabled stays true so the People/Teams/Roles/Security settings tabs remain available, the banner notes the admin data is sample data, and the mobile editor icon is an inline SVG so it always renders.
This commit is contained in:
SnapOtter
2026-07-07 23:12:37 +08:00
committed by GitHub
parent 7329bc6a13
commit a94b69b14f
6 changed files with 107 additions and 57 deletions
+11
View File
@@ -36,6 +36,17 @@ describe("demo mock API", () => {
});
});
it("returns an authenticated admin session so the demo skips the login screen", async () => {
const response = matchDemoRoute("/api/auth/session", "GET");
expect(response?.status).toBe(200);
const data = (await readJson(response as Response)) as {
user: { role: string; mustChangePassword: boolean; permissions: string[] };
};
expect(data.user.role).toBe("admin");
expect(data.user.mustChangePassword).toBe(false);
expect(Array.isArray(data.user.permissions)).toBe(true);
});
// These lock in the exact response shapes the admin settings screens read.
// A missing array here is what produced the "can't access property filter"
// crash: the People tab calls /auth/users, and the mock used to answer only