Skip to content

Commit a45dbf5

Browse files
VIA-599 AS/SB Create multi vaccines hub page
1 parent b4a6796 commit a45dbf5

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

e2e/constants.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type PoliciesPageName = "cookies-policy" | "accessibility-statement";
22
type VaccinePageName = "rsv-older-adults" | "rsv-pregnancy" | "td-ipv";
33
type FailurePageName = "sso-failure" | "service-failure" | "not-found";
44
type SessionPageName = "session-timeout" | "session-logout";
5-
type IndexPageName = "vaccines-hub" | "vaccines-for-all-ages";
5+
type IndexPageName = "vaccines-hub" | "vaccines-for-all-ages" | "multi-vaccines-hub";
66

77
export type PageName = IndexPageName | VaccinePageName | FailurePageName | SessionPageName | PoliciesPageName;
88
export type PageDetails = {
@@ -23,6 +23,12 @@ export const AppPageDetails: Record<PageName, PageDetails> = {
2323
title: `${SERVICE_HEADING} - ${NHS_TITLE_SUFFIX}`,
2424
snapshotFilename: "default-hub.png",
2525
},
26+
"multi-vaccines-hub": {
27+
url: "/check-and-book-vaccinations",
28+
heading: `${SERVICE_HEADING}`,
29+
title: `${SERVICE_HEADING} - ${NHS_TITLE_SUFFIX}`,
30+
snapshotFilename: "default-multi-vaccines-hub.png",
31+
},
2632
"vaccines-for-all-ages": {
2733
url: "/vaccines-for-all-ages",
2834
heading: "Vaccines for all ages",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import VaccinationsHub from "@src/app/check-and-book-vaccinations/page";
2+
import { render, screen } from "@testing-library/react";
3+
4+
describe("Vaccination Hub Page", () => {
5+
beforeEach(async () => {
6+
render(VaccinationsHub());
7+
});
8+
9+
it("renders heading", async () => {
10+
expectHeadingToBeRendered();
11+
});
12+
});
13+
14+
const expectHeadingToBeRendered = () => {
15+
expect(queryHeading("Check and book an RSV vaccination", 1)).toBeVisible();
16+
};
17+
18+
const queryHeading = (text: string, level: number): HTMLElement | null => {
19+
return screen.queryByRole("heading", {
20+
name: text,
21+
level: level,
22+
});
23+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NHS_TITLE_SUFFIX, SERVICE_HEADING } from "@src/app/constants";
2+
import React from "react";
3+
4+
const VaccinationsHub = () => {
5+
return (
6+
<>
7+
<title>{`${SERVICE_HEADING} - ${NHS_TITLE_SUFFIX}`}</title>
8+
<h1 className={"app-dynamic-page-title__heading"}>{SERVICE_HEADING}</h1>
9+
</>
10+
);
11+
};
12+
13+
export default VaccinationsHub;

0 commit comments

Comments
 (0)