344a32e3e4
- Add "Start a new booking" button to BookingError linking to /admin/book - Add "Book again" button to BookingCancelled linking to /admin/book - Add business contact info section to BookingError (from BUSINESS_CONTACT_INFO constant) - Replace hardcoded colors with CSS variables (--color-error, --color-cancelled, etc.) - Add page-level string constants to eliminate hardcoded strings - Add unit tests for both pages (9 tests passing) Co-Authored-By: Paperclip <noreply@paperclip.ing>
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { render, screen } from "@testing-library/react";
|
|
import { BookingCancelledPage } from "../pages/BookingCancelled.tsx";
|
|
|
|
describe("BookingCancelledPage", () => {
|
|
it("renders the cancelled heading", () => {
|
|
render(<BookingCancelledPage />);
|
|
expect(screen.getByRole("heading", { name: /Appointment Cancelled/i })).toBeInTheDocument();
|
|
});
|
|
|
|
it("renders the cancelled body text", () => {
|
|
render(<BookingCancelledPage />);
|
|
expect(screen.getByText(/Your appointment has been cancelled/i)).toBeInTheDocument();
|
|
});
|
|
|
|
it("has a Book again link pointing to /admin/book", () => {
|
|
render(<BookingCancelledPage />);
|
|
const link = screen.getByRole("link", { name: /Book again/i });
|
|
expect(link).toHaveAttribute("href", "/admin/book");
|
|
});
|
|
|
|
it("has a Back to Portal link pointing to /", () => {
|
|
render(<BookingCancelledPage />);
|
|
const link = screen.getByRole("link", { name: /Back to Portal/i });
|
|
expect(link).toHaveAttribute("href", "/");
|
|
});
|
|
});
|