Files
pleno-vue/tests/e2e/userInvoices.spec.ts
T
Jeppe Bundgaard 60742bf947 Refactor and migrate Playwright E2E tests:
- Remove `playwright.config.js` to clean up configuration.
- Add new E2E test suites (`admin-pos-orders`, `admin-module-goals`, `admin-module-pos-mobile-order-flow`) to structure Admin module tests.
- Introduce reusable authentication and data seeding utilities in `fixtures` for streamlined test flows and maintainability.
2026-03-19 12:46:47 +01:00

42 lines
1.3 KiB
TypeScript

import { test, expect } from '@playwright/test';
import {
userCredentials,
loginAsUser,
} from './fixtures';
/** User invoices Tests */
// User invoices page content tests
test('[PAGES][User][/user/invoices] should load the page', async ({ page }) => {
await loginAsUser(page);
await page.goto('/user/invoices');
await expect(page).toHaveURL(/invoices/);
});
test('[PAGES][User][/user/invoices] should display the title', async ({ page }) => {
await loginAsUser(page);
await page.goto('/user/invoices');
await expect(page.locator('.title')).toContainText('Oversigt over fakturaer');
});
// Invoices table tests
test('[PAGES][User][/user/invoices] should display the invoices table', async ({ page }) => {
await loginAsUser(page);
await page.goto('/user/invoices');
await expect(page.locator('table.is-fullwidth')).toBeVisible();
});
test('[PAGES][User][/user/invoices] should show empty invoices list', async ({ page }) => {
await loginAsUser(page);
await page.goto('/user/invoices');
await expect(page.locator('tbody tr')).toHaveCount(0);
});
test('[PAGES][User][/user/invoices] should display table headers', async ({ page }) => {
await loginAsUser(page);
await page.goto('/user/invoices');
await expect(page.locator('thead th')).toHaveCount(6);
});
// TODO: tests for pagination, search, download, details, mobile, etc.
// ...