- Added `completeBookingCreationFlow` utility to streamline booking creation logic in `bookingFlow.ts`. - Refactored `userBookings.spec.ts` to replace inline booking creation steps with the new utility for improved readability and consistency. - Applied `data-testid` attributes across booking-related components for enhanced testability and test coverage. - Enhanced Playwright navigation error handling with `isBenignNavigationError` and `settleAuthenticatedNavigation` utilities to improve resilience and test robustness.
23 lines
937 B
TypeScript
23 lines
937 B
TypeScript
import { expect, test } from "@playwright/test";
|
|
import { loginAsUser } from "./fixtures";
|
|
|
|
test("[PAGES][User][/user/vehicles] shows the current vehicles overview shell", async ({ page }) => {
|
|
await loginAsUser(page);
|
|
await page.goto("/user/vehicles");
|
|
|
|
await expect(page.getByTestId("user-vehicles-add")).toBeVisible();
|
|
await expect(page.getByTestId("user-vehicles-table")).toBeVisible();
|
|
});
|
|
|
|
test("[PAGES][User][/user/vehicles] opens the add-vehicle dialog", async ({ page }) => {
|
|
await loginAsUser(page);
|
|
await page.goto("/user/vehicles");
|
|
|
|
await page.getByTestId("user-vehicles-add").click();
|
|
const dialog = page.getByRole("dialog");
|
|
await expect(dialog).toBeVisible();
|
|
await expect(dialog.getByRole("heading", { name: /opret/i })).toBeVisible();
|
|
await expect(dialog.getByRole("button", { name: /gem/i })).toBeVisible();
|
|
await expect(dialog.getByRole("button", { name: /annuller/i })).toBeVisible();
|
|
});
|