From 153311494d58c4646c973b58cd29c482dab4c4f0 Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Fri, 23 Oct 2026 20:22:32 +0200 Subject: [PATCH] Allow cold lazy modules to load in library tests --- e2e/library.spec.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e/library.spec.js b/e2e/library.spec.js index 7423f51..4430688 100644 --- a/e2e/library.spec.js +++ b/e2e/library.spec.js @@ -4,6 +4,8 @@ import { test, expect } from "@playwright/test"; import { LIBRARY_CATEGORY_DEFINITIONS } from "../website/src/features/toolboxes/toolboxModuleRegistry.js"; import { resetSokkoStorage } from "./helpers/storage.js"; +const LAZY_TOOL_TIMEOUT = 15_000; + async function readStoredLibraryCopy(page) { return page.evaluate(async () => new Promise((resolve, reject) => { const request = window.indexedDB.open("sokkog", 1); @@ -23,6 +25,7 @@ async function readStoredLibraryCopy(page) { } test("loads every library tool through the shared component registry", async ({ page }) => { + test.slow(); const errors = []; page.on("pageerror", (error) => errors.push(error.message)); page.on("console", (message) => { @@ -35,8 +38,8 @@ test("loads every library tool through the shared component registry", async ({ 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(); + await expect(tool.getByText("Chargement de l'outil...")).toHaveCount(0, { timeout: LAZY_TOOL_TIMEOUT }); + await expect(tool.locator(":scope > *").first()).toBeVisible({ timeout: LAZY_TOOL_TIMEOUT }); } } }