fix(M3-M11): clients meta pagination, client detail types, sidebar icon imports, payments error state; add E2E specs for all modules
This commit is contained in:
42
e2e/invoices.spec.ts
Normal file
42
e2e/invoices.spec.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { login } from './helpers/auth';
|
||||
|
||||
test.describe('Invoices', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/invoices');
|
||||
});
|
||||
|
||||
test('invoices page renders', async ({ page }) => {
|
||||
await expect(page.locator('h1:has-text("Invoices")')).toBeVisible();
|
||||
await expect(page.locator('table')).toBeVisible();
|
||||
});
|
||||
|
||||
test('invoice rows load', async ({ page }) => {
|
||||
await page.waitForSelector('tbody tr', { timeout: 15000 });
|
||||
const rows = page.locator('tbody tr');
|
||||
const count = await rows.count();
|
||||
expect(count).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('status filter chips work', async ({ page }) => {
|
||||
await page.waitForSelector('tbody tr', { timeout: 10000 });
|
||||
// Status filter buttons should exist
|
||||
const filterBtn = page.locator('button:has-text("OVERDUE"), button:has-text("Overdue")').first();
|
||||
if (await filterBtn.isVisible()) {
|
||||
await filterBtn.click();
|
||||
await page.waitForTimeout(500);
|
||||
// Should filter without crashing
|
||||
await expect(page.locator('h1:has-text("Invoices")')).toBeVisible();
|
||||
}
|
||||
});
|
||||
|
||||
test('clicking invoice row opens detail modal', async ({ page }) => {
|
||||
await page.waitForSelector('tbody tr', { timeout: 15000 });
|
||||
await page.locator('tbody tr').first().click();
|
||||
// Modal or detail should open
|
||||
await page.waitForTimeout(500);
|
||||
// Should show some invoice details
|
||||
await expect(page.locator('text=Invoice')).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user