test: finalize all E2E specs (auth/dashboard/clients/invoices/payments/tickets/leads/remittances/reports/settings/audit-log)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user