Files
pleno-vue/tests/e2e/subuserProfileSecurity.spec.ts
T
Jeppe Bundgaard 828e2fd312 Add test cases for internationalization, orders table rendering, and error handling:
- **Internationalization:** Added end-to-end test `i18n.smoke.spec.ts` to validate Danish locale translations. Ensured normalization and removed unexpected strings in the `da` locale file.
- **Orders Table:** Created unit test `orders-table.spec.js` to verify sparse data handling, invoice collection preloading, and rendering correctness.
- **Error Handling:** Enhanced connectivity issue UI (`ConnectivityIssue.vue`) with `data-testid` attributes for improved testability.
- **E2E Playwright Tests:** Updated and simplified e2e test utilities. Replaced `seedAuthenticatedState` with `primeMockSession` for session preparation. Added new tests for `/user/orders` and `/user/invoices` pages focusing on edge cases and maintaining structure consistency.
2026-04-13 12:44:06 +02:00

31 lines
1.4 KiB
TypeScript

import { expect, test } from "@playwright/test";
import { loginAsSubuserByPhone } from "./fixtures";
async function openSubuserSecurity(page) {
await loginAsSubuserByPhone(page);
await page.goto("/user/profile");
const securityCard = page.getByTestId("subuser-profile-security-card");
await expect(securityCard).toBeVisible();
await securityCard.locator(".card-header").click();
await expect(page.getByTestId("subuser-profile-security-logout")).toBeVisible();
}
test("[PROFILE][Subuser][Security] renders the current security surface", async ({ page }) => {
await openSubuserSecurity(page);
await expect(page.getByTestId("subuser-profile-security-logout")).toBeVisible();
await expect(page.getByTestId("subuser-profile-passkeys").getByTestId("passkey-add")).toBeVisible();
await expect(page.getByTestId("subuser-profile-two-factor").getByTestId("two-factor-status")).toBeVisible();
const enableButton = page.getByTestId("subuser-profile-two-factor").getByTestId("two-factor-enable");
const disableButton = page.getByTestId("subuser-profile-two-factor").getByTestId("two-factor-disable");
expect((await enableButton.count()) + (await disableButton.count())).toBeGreaterThan(0);
});
test("[PROFILE][Subuser][Security] opens the logout confirmation dialog", async ({ page }) => {
await openSubuserSecurity(page);
await page.getByTestId("subuser-profile-security-logout").click();
await expect(page.locator(".swal2-popup")).toBeVisible();
});