23 lines
907 B
TypeScript
23 lines
907 B
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('Collection View', () => {
|
|
test('should show empty state message if no bottles found', async ({ page }) => {
|
|
// This test assumes a clean or specific state.
|
|
// In a real environment, we'd use a test user with 0 bottles.
|
|
await page.goto('/');
|
|
|
|
// If we can't control the user, we at least check that we don't see the technical error message
|
|
const errorBox = page.locator('text=Hoppla');
|
|
await expect(errorBox).not.toBeVisible();
|
|
|
|
// Check for either the grid or the empty state message
|
|
const emptyMessage = page.locator('text=Noch keine Flaschen im Vault');
|
|
const bottleGrid = page.locator('.grid');
|
|
|
|
const isGridVisible = await bottleGrid.isVisible();
|
|
if (!isGridVisible) {
|
|
await expect(emptyMessage).toBeVisible();
|
|
}
|
|
});
|
|
});
|