🐛 Fix libraries modal visual test (#12367)

The libraries modal now opens on the "This file" tab, so the visual test
timed out looking for the shared library. Open the "Libraries" tab first,
as the functional test does, mock the file with the library linked, and
check the "Added" label instead of the old "File library" text.

AI-assisted-by: claude-opus-5-5
This commit is contained in:
Eva Marco 2026-10-15 20:08:48 +02:00 committed by GitHub
parent 539983db2f
commit ab7a994d6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,10 +158,15 @@ test.describe("Assets tab", () => {
await workspace.openLibrariesModal();
await expect(workspace.page).toHaveScreenshot();
await workspace.librariesModal
.getByRole("tab", { name: "Libraries" })
.click();
await expect(workspace.page).toHaveScreenshot();
// Now the get-file call should return a library
await workspace.mockRPC(/get\-file\?/, "workspace/get-file-library.json");
await workspace.clickLibrary("Testing library 1");
await expect(
workspace.librariesModal.getByText("File library"),
).toBeVisible();
await expect(workspace.librariesModal.getByText("Added")).toBeVisible();
await expect(workspace.page).toHaveScreenshot();
});