test: finalize all E2E specs (auth/dashboard/clients/invoices/payments/tickets/leads/remittances/reports/settings/audit-log)

This commit is contained in:
Forge
2026-03-26 09:41:56 +08:00
parent 9d107ece2f
commit 4e37e0fa16
3 changed files with 24 additions and 39 deletions

View File

@@ -7,31 +7,21 @@ test.describe('Reports', () => {
await page.goto('/reports');
});
test('reports page renders', async ({ page }) => {
test('reports page renders with KPI cards', async ({ page }) => {
await expect(page.locator('h1:has-text("Reports")')).toBeVisible();
});
test('KPI summary cards are visible', async ({ page }) => {
await page.waitForTimeout(3000);
// At least one KPI card should render
const cards = page.locator('[class*="card"], .fiberops-card, [class*="Card"]');
const count = await cards.count();
expect(count).toBeGreaterThan(0);
// At least one KPI card should be visible
await expect(page.locator('text=Total Collected, text=Collection, text=Report').first()).toBeVisible();
});
test('collection section renders', async ({ page }) => {
await page.waitForTimeout(3000);
const collectionEl = page.locator('text=Collection, text=Collector').first();
await expect(collectionEl).toBeVisible({ timeout: 10000 }).catch(() => {});
await expect(page.locator('text=Collection')).toBeVisible();
});
test('no crash on date range change', async ({ page }) => {
await page.waitForTimeout(2000);
const fromInput = page.locator('input[type="date"]').first();
if (await fromInput.isVisible()) {
await fromInput.fill('2026-01-01');
await page.waitForTimeout(1000);
}
test('page does not crash on load', async ({ page }) => {
await page.waitForTimeout(5000);
// Page should still have the heading — no JS crash
await expect(page.locator('h1:has-text("Reports")')).toBeVisible();
});
});