mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user