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:
@@ -66,18 +66,20 @@ describe("MobileBottomNav", () => {
|
||||
expect(screen.queryByText("Settings")).toBeNull();
|
||||
});
|
||||
|
||||
it("renders icons for each navigation item", () => {
|
||||
it("renders an svg icon for each navigation item", () => {
|
||||
renderNav(() => {});
|
||||
|
||||
// 4 items use lucide SVG icons (Tools, Automate, Files, Settings)
|
||||
// Editor uses ImageEditIcon which is a CSS-masked <span>, not SVG
|
||||
// All five items (Tools, Automate, Editor, Files, Settings) render inline
|
||||
// SVG icons. The Editor icon used to be a CSS-masked <span> that rendered
|
||||
// as nothing when its mask asset failed to load; it is now an inline SVG
|
||||
// like the rest, so it always draws.
|
||||
const svgs = document.querySelectorAll("nav svg");
|
||||
expect(svgs.length).toBe(4);
|
||||
expect(svgs.length).toBe(5);
|
||||
|
||||
// The Editor icon is a span with a mask-image
|
||||
const spans = document.querySelectorAll("nav span");
|
||||
const maskedSpan = Array.from(spans).find((s) => (s as HTMLElement).style.maskImage !== "");
|
||||
expect(maskedSpan).toBeDefined();
|
||||
const editorLink = Array.from(document.querySelectorAll("a")).find(
|
||||
(a) => a.getAttribute("href") === "/editor",
|
||||
);
|
||||
expect(editorLink?.querySelector("svg")).not.toBeNull();
|
||||
});
|
||||
|
||||
it("nav has backdrop blur and border-top styling", () => {
|
||||
|
||||
Reference in New Issue
Block a user