Audit the project and secure toolbox data

This commit is contained in:
Shinuwa 2026-10-14 16:59:09 +02:00
parent 96af62edf0
commit e87edda5c7
40 changed files with 2324 additions and 125 deletions

View file

@ -73,6 +73,11 @@ test("creates at most five spaces and moves tools with the accessible selector",
await expect(page.getByRole("button", { name: "Nouvel espace" })).toBeEnabled();
await expect(page.getByRole("tab", { name: "Défaut" })).toHaveAttribute("aria-selected", "true");
await expect(page.locator("[data-module-id='a']")).toBeVisible();
await expect.poll(() => page.evaluate(async () => {
const db = await import("/src/utils/indexedDbStorage.js");
const toolbox = (await db.getToolboxes()).find((item) => item.id === "spaces");
return toolbox?.activeSpaceId === toolbox?.defaultSpaceId && toolbox?.spaces.length === 4;
})).toBe(true);
await page.reload();
await expect(page.getByRole("tab", { name: "Défaut" })).toHaveAttribute("aria-selected", "true");
});
@ -199,6 +204,10 @@ test("the linked game drawer shares the persisted active space", async ({ page }
await expect(drawer.locator("[data-module-id='a']")).toBeVisible();
await drawer.getByRole("tab", { name: "Défaut" }).click();
await expect(drawer.locator("[data-module-id='a']")).toHaveCount(0);
await expect.poll(() => page.evaluate(async () => {
const db = await import("/src/utils/indexedDbStorage.js");
return (await db.getToolboxes()).find((item) => item.id === "drawer-spaces")?.activeSpaceId;
})).toBe("default");
await page.reload();
await page.getByRole("tab", { name: "Toolbox", exact: true }).click();
await expect(page.locator("#toolbox-drawer").getByRole("tab", { name: "Défaut" })).toHaveAttribute("aria-selected", "true");