test(workspace): assert empty collections through their status

This commit is contained in:
Vito Sansevero
2026-10-17 11:09:42 -07:00
parent e9021362c6
commit b3189f558d
+8 -2
View File
@@ -28,8 +28,14 @@ test('workspace serves real library data beside either ComfyUI renderer', async
await expect(workspace.locator('#workspace-main h1')).toHaveText('Images');
const images = await imageResponse;
expect(images.ok()).toBe(true);
expect((await images.json()).success).toBe(true);
await expect(workspace.getByRole('list', { name: 'Image collection', exact: true })).toBeVisible();
const collection = await images.json();
expect(collection.success).toBe(true);
await expect(workspace.getByRole('list', { name: 'Image collection', exact: true })).toBeAttached();
if (collection.images.length) {
await expect(workspace.locator('article[data-image-key]').first()).toBeVisible();
} else {
await expect(workspace.getByText('No matching images or media. Try changing the filters.', { exact: true })).toBeVisible();
}
await expect(workspace.locator('#workspace-main a[href="/prompt_manager/gallery"]')).toHaveAttribute('href', '/prompt_manager/gallery');
await workspace.reload();
await expect(workspace.locator('#workspace-main h1')).toHaveText('Images');