sokko-g/e2e/home.spec.js
Shinuwa 22b397ebfa Document Sokko G's architecture and folders, and move JavaScript file headers to JSDoc @file blocks
Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md
(setup and step-by-step recipes) and a README in each main folder, with an
index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to
JSDoc @file blocks, define a three-level header template in website/AGENTS.md
and check the header in tests/file-headers.test.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:42:13 +01:00

39 lines
1.7 KiB
JavaScript

/**
* @file Vérifie en navigateur que la home charge les zones principales.
*/
import { expect, test } from "@playwright/test";
import { resetSokkoStorage } from "./helpers/storage.js";
test.beforeEach(async ({ page }) => resetSokkoStorage(page));
test("home page renders the application shell", async ({ page }) => {
await page.goto("/");
await expect(page.locator(".app-shell")).toBeVisible();
const main = page.getByRole("main");
const hero = main.locator(".hero");
await expect(main).toBeVisible();
await expect(main.getByRole("heading", { name: "Sokko G", exact: true })).toBeVisible();
const create = hero.getByRole("button", { name: "Créer ma première toolbox", exact: true });
await expect(create).toBeVisible();
await expect(main.getByRole("link", { name: "Voir les jeux", exact: true })).toBeVisible();
await expect(page.locator(".home-stats")).toBeVisible();
await expect(page.locator(".origin-section")).toBeVisible();
await create.click();
await expect(page.getByRole("dialog", { name: "Nouvelle toolbox", exact: true })).toBeVisible();
});
test("home links to the toolbox list once a toolbox exists", async ({ page }) => {
await page.locator(".hero").getByRole("button", { name: "Créer ma première toolbox", exact: true }).click();
const dialog = page.getByRole("dialog", { name: "Nouvelle toolbox", exact: true });
await dialog.getByRole("textbox", { name: "Nom", exact: true }).fill("Accueil contextualisé");
await dialog.getByRole("button", { name: "Créer", exact: true }).click();
await page.goto("/#/");
const link = page.getByRole("main").getByRole("link", { name: "Voir mes toolboxes", exact: true });
await expect(link).toBeVisible();
await link.click();
await expect(page).toHaveURL(/#\/toolboxes$/);
});