diff --git a/frontend/playwright/data/workspace/audit-event-empty.json b/frontend/playwright/data/workspace/audit-event-empty.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/frontend/playwright/data/workspace/audit-event-empty.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/frontend/playwright/ui/pages/WorkspacePage.js b/frontend/playwright/ui/pages/WorkspacePage.js index 76f0c0534..7e5bf6b36 100644 --- a/frontend/playwright/ui/pages/WorkspacePage.js +++ b/frontend/playwright/ui/pages/WorkspacePage.js @@ -202,6 +202,7 @@ export class WorkspacePage extends BaseWebSocketPage { async openLibrariesModal(clickOptions = {}) { await this.sidebar.getByText("Libraries").click(clickOptions); + await expect(this.librariesModal).toBeVisible(); } async clickLibrary(name, clickOptions = {}) { diff --git a/frontend/playwright/ui/visual-specs/workspace.spec.js b/frontend/playwright/ui/visual-specs/workspace.spec.js index 69cc5a34d..e594ea343 100644 --- a/frontend/playwright/ui/visual-specs/workspace.spec.js +++ b/frontend/playwright/ui/visual-specs/workspace.spec.js @@ -83,14 +83,22 @@ test.describe("Assets tab", () => { "workspace/get-team-shared-libraries-non-empty.json", ); + await workspace.mockRPC( + "push-audit-events", + "workspace/audit-event-empty.json", + ); + await workspace.goToWorkspace(); await workspace.clickAssets(); await workspace.openLibrariesModal(); - await expect(workspace.page).toHaveScreenshot(); await workspace.clickLibrary("Testing library 1"); - + await expect( + workspace.librariesModal.getByText( + "There are no Shared Libraries available", + ), + ).toBeVisible(); await expect(workspace.page).toHaveScreenshot(); });