sokko-g/e2e/library.spec.js
Shinuwa 34524d2961
Some checks failed
Deploy Sokko G / deploy (push) Failing after 2s
Share toolbox components and fix image and calendar updates
2026-09-10 14:19:55 +02:00

24 lines
1.1 KiB
JavaScript

// Rôle : vérifie le chargement des outils de chaque catégorie de la librairie.
import { test, expect } from "@playwright/test";
import { LIBRARY_CATEGORY_DEFINITIONS } from "../website/src/features/toolboxes/toolboxModuleRegistry.js";
test("loads every library tool through the shared component registry", async ({ page }) => {
const errors = [];
page.on("pageerror", (error) => errors.push(error.message));
page.on("console", (message) => {
if (message.type() === "error") errors.push(message.text());
});
await page.goto("/#/library");
for (const category of LIBRARY_CATEGORY_DEFINITIONS) {
await page.locator(`.library-doc-nav-group > a[href="#/library#library-category-${category.key}"]`).click();
for (const type of category.types) {
const tools = page.locator(`[data-module-type="${type}"] .module-content`);
await expect(tools.first()).toBeVisible();
for (const tool of await tools.all()) {
await expect(tool.getByText("Chargement de l'outil...")).toHaveCount(0);
await expect(tool.locator(":scope > *").first()).toBeVisible();
}
}
}
expect(errors).toEqual([]);
});