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:
Forge
2026-03-26 09:41:15 +08:00
parent 562ff9e9b6
commit 9d107ece2f
13 changed files with 390 additions and 24 deletions

31
e2e/leads.spec.ts Normal file
View File

@@ -0,0 +1,31 @@
import { test, expect } from '@playwright/test';
import { login } from './helpers/auth';
test.describe('Leads', () => {
test.beforeEach(async ({ page }) => {
await login(page);
await page.goto('/leads');
});
test('leads page renders with pipeline summary', async ({ page }) => {
await expect(page.locator('h1:has-text("Leads")')).toBeVisible();
});
test('leads list loads', async ({ page }) => {
await page.waitForTimeout(2000);
// Either shows rows or empty state
const hasRows = await page.locator('tbody tr').count();
const hasEmpty = await page.locator('text=No leads').isVisible().catch(() => false);
expect(hasRows > 0 || hasEmpty).toBeTruthy();
});
test('Add Lead modal opens and closes', async ({ page }) => {
const addBtn = page.locator('button:has-text("Add Lead")');
if (await addBtn.isVisible()) {
await addBtn.click();
await page.waitForTimeout(300);
await expect(page.locator('text=Add Lead, text=New Lead').first()).toBeVisible();
await page.keyboard.press('Escape');
}
});
});