11import { useBrowserContext } from "@src/app/_components/context/BrowserContext" ;
22import AppHeader from "@src/app/_components/nhs-frontend/AppHeader" ;
3+ import { SERVICE_HEADING } from "@src/app/constants" ;
34import { userLogout } from "@src/utils/auth/user-logout" ;
45import { mockNHSAppJSFunctions } from "@src/utils/nhsapp-js.test" ;
56import { render , screen } from "@testing-library/react" ;
@@ -18,7 +19,7 @@ jest.mock("@src/utils/auth/user-logout", () => ({
1819} ) ) ;
1920
2021const expectHeaderVisible = ( expectedVisible : boolean ) => {
21- const serviceLink : HTMLElement | null = screen . queryByText ( "Check and book an RSV vaccination" ) ;
22+ const serviceLink : HTMLElement | null = screen . queryByText ( SERVICE_HEADING ) ;
2223 const logo : HTMLElement | null = screen . queryByRole ( "img" , { name : "NHS" } ) ;
2324
2425 if ( expectedVisible ) {
@@ -60,7 +61,7 @@ describe("AppHeader", () => {
6061 render ( < AppHeader /> ) ;
6162
6263 const logoAndServiceLink : HTMLElement = screen . getByRole ( "link" , {
63- name : " NHS Check and book an RSV vaccination homepage" ,
64+ name : ` NHS ${ SERVICE_HEADING } homepage` ,
6465 } ) ;
6566
6667 expect ( logoAndServiceLink ?. getAttribute ( "href" ) ) . toEqual ( "/check-and-book-rsv" ) ;
@@ -91,7 +92,7 @@ describe("AppHeader", () => {
9192 render ( < AppHeader /> ) ;
9293
9394 const logoAndServiceLink : HTMLElement = screen . getByRole ( "link" , {
94- name : " NHS Check and book an RSV vaccination homepage" ,
95+ name : ` NHS ${ SERVICE_HEADING } homepage` ,
9596 } ) ;
9697
9798 expect ( logoAndServiceLink . getAttribute ( "href" ) ) . toEqual ( "#" ) ;
0 commit comments