24 lines
1.1 KiB
JavaScript
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([]);
|
|
});
|