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:
31
e2e/leads.spec.ts
Normal file
31
e2e/leads.spec.ts
Normal 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');
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user