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.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { mockApi, seedAuthenticatedState } from "./support/network.js";
|
||||
import { mockApi, primeMockSession } from "./support/network.js";
|
||||
|
||||
function json(body, status = 200) {
|
||||
return {
|
||||
@@ -11,16 +11,7 @@ function json(body, status = 200) {
|
||||
|
||||
async function primeSuperuserSession(page) {
|
||||
const token = "superuser-system-status-token";
|
||||
await seedAuthenticatedState(page, token);
|
||||
await page.goto("/login");
|
||||
await page.evaluate(async (sessionToken) => {
|
||||
const sessionModule = await import("/src/components/session/token/SessionUser.vue");
|
||||
window.localStorage.setItem("token", sessionToken);
|
||||
sessionModule.SessionUser.token.value = sessionToken;
|
||||
sessionModule.SessionUser.authenticated.value = true;
|
||||
sessionModule.SessionUser.permissions.value = ["superuser", "user"];
|
||||
sessionModule.SessionUser.initiated.value = true;
|
||||
}, token);
|
||||
await primeMockSession(page, { token });
|
||||
}
|
||||
|
||||
async function installSystemStatusMock(page, snapshot) {
|
||||
|
||||
Reference in New Issue
Block a user