File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed
src/app/check-and-book-vaccinations Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,16 @@ test.describe("Navigation", () => {
1616 await clickLinkAndExpectPageTitle ( page , "Back" , AppPageDetails [ "vaccines-hub" ] . title ) ;
1717 } ) ;
1818
19+ test ( "Vaccines and back links from multi vaccine hub page" , async ( { page } ) => {
20+ await page . goto ( AppPageDetails [ "multi-vaccines-hub" ] . url ) ;
21+ await clickLinkAndExpectPageTitle (
22+ page ,
23+ "View vaccines for all ages" ,
24+ AppPageDetails [ "vaccines-for-all-ages" ] . title ,
25+ ) ;
26+ await clickLinkAndExpectPageTitle ( page , "Back" , AppPageDetails [ "multi-vaccines-hub" ] . title ) ;
27+ } ) ;
28+
1929 test ( "Vaccines and back links from vaccines-for-all-ages page" , async ( { page } ) => {
2030 await page . goto ( AppPageDetails [ "vaccines-for-all-ages" ] . url ) ;
2131 await clickLinkAndExpectPageTitle ( page , "RSV" , AppPageDetails [ "rsv-older-adults" ] . title ) ;
Original file line number Diff line number Diff line change @@ -2,14 +2,22 @@ import VaccinationsHub from "@src/app/check-and-book-vaccinations/page";
22import { SERVICE_HEADING } from "@src/app/constants" ;
33import { render , screen } from "@testing-library/react" ;
44
5+ jest . mock ( "@src/app/_components/nhs-app/BackToNHSAppLink" ) ;
6+
57describe ( "Vaccination Hub Page" , ( ) => {
68 beforeEach ( async ( ) => {
7- render ( VaccinationsHub ( ) ) ;
9+ render ( < VaccinationsHub /> ) ;
810 } ) ;
911
1012 it ( "renders heading" , async ( ) => {
1113 expectHeadingToBeRendered ( ) ;
1214 } ) ;
15+
16+ it ( "renders vaccines for all ages button" , async ( ) => {
17+ const button = screen . getByRole ( "link" , { name : "View vaccines for all ages" } ) ;
18+ expect ( button ) . toBeVisible ( ) ;
19+ expect ( button ) . toHaveAttribute ( "href" , "/vaccines-for-all-ages" ) ;
20+ } ) ;
1321} ) ;
1422
1523const expectHeadingToBeRendered = ( ) => {
Original file line number Diff line number Diff line change 1+ import BackToNHSAppLink from "@src/app/_components/nhs-app/BackToNHSAppLink" ;
2+ import MainContent from "@src/app/_components/nhs-frontend/MainContent" ;
13import { NHS_TITLE_SUFFIX , SERVICE_HEADING } from "@src/app/constants" ;
4+ import Link from "next/link" ;
25import React from "react" ;
36
47const VaccinationsHub = ( ) => {
58 return (
69 < >
710 < title > { `${ SERVICE_HEADING } - ${ NHS_TITLE_SUFFIX } ` } </ title >
8- < h1 className = { "app-dynamic-page-title__heading" } > { SERVICE_HEADING } </ h1 >
11+ < BackToNHSAppLink />
12+ < MainContent >
13+ < h1 className = { "app-dynamic-page-title__heading" } > { SERVICE_HEADING } </ h1 >
14+ < Link href = { "/vaccines-for-all-ages" } className = { "nhsuk-button nhsuk-button--secondary" } >
15+ View vaccines for all ages
16+ </ Link >
17+ </ MainContent >
918 </ >
1019 ) ;
1120} ;
You can’t perform that action at this time.
0 commit comments