File tree Expand file tree Collapse file tree 8 files changed +2
-26
lines changed
Expand file tree Collapse file tree 8 files changed +2
-26
lines changed Original file line number Diff line number Diff line change 11import { render , screen } from "@testing-library/react" ;
22import Schedule from "./page" ;
33import { JSX } from "react" ;
4+ import { assertBackLinkIsPresent } from "@test-data/test-helpers-back-link" ;
45
56jest . mock ( "@src/app/_components/nhs-frontend/BackLink" , ( ) =>
67 jest . fn ( ( ) => < div data-testid = "back-link" > </ div > ) ,
78) ;
89jest . mock ( "@src/services/content-api/gateway/content-reader-service" ) ;
9- jest . mock ( "next/navigation" , ( ) => ( {
10- useRouter : jest . fn ( ) ,
11- } ) ) ;
1210
1311describe ( "Schedule Page" , ( ) => {
1412 beforeEach ( ( ) => {
@@ -97,7 +95,6 @@ describe("Schedule Page", () => {
9795 } ) ;
9896
9997 it ( "should contain back link" , ( ) => {
100- const backLink = screen . getByTestId ( "back-link" ) ;
101- expect ( backLink ) . toBeInTheDocument ( ) ;
98+ assertBackLinkIsPresent ( screen ) ;
10299 } ) ;
103100} ) ;
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import { mockStyledContent } from "@test-data/content-api/data";
66import { VaccineTypes } from "@src/models/vaccine" ;
77import { assertBackLinkIsPresent } from "@test-data/test-helpers-back-link" ;
88
9- jest . mock ( "next/navigation" , ( ) => ( {
10- useRouter : jest . fn ( ) ,
11- } ) ) ;
129jest . mock ( "@src/services/content-api/gateway/content-reader-service" ) ;
1310jest . mock ( "@src/app/_components/vaccine/Vaccine" , ( ) => jest . fn ( ( ) => < div /> ) ) ;
1411jest . mock ( "@src/app/_components/nhs-frontend/BackLink" , ( ) =>
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import { mockStyledContent } from "@test-data/content-api/data";
66import { VaccineTypes } from "@src/models/vaccine" ;
77import { assertBackLinkIsPresent } from "@test-data/test-helpers-back-link" ;
88
9- jest . mock ( "next/navigation" , ( ) => ( {
10- useRouter : jest . fn ( ) ,
11- } ) ) ;
129jest . mock ( "@src/services/content-api/gateway/content-reader-service" ) ;
1310jest . mock ( "@src/app/_components/vaccine/Vaccine" , ( ) => jest . fn ( ( ) => < div /> ) ) ;
1411jest . mock ( "@src/app/_components/nhs-frontend/BackLink" , ( ) =>
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import { mockStyledContent } from "@test-data/content-api/data";
66import { VaccineTypes } from "@src/models/vaccine" ;
77import { assertBackLinkIsPresent } from "@test-data/test-helpers-back-link" ;
88
9- jest . mock ( "next/navigation" , ( ) => ( {
10- useRouter : jest . fn ( ) ,
11- } ) ) ;
129jest . mock ( "@src/services/content-api/gateway/content-reader-service" ) ;
1310jest . mock ( "@src/app/_components/vaccine/Vaccine" ) ;
1411jest . mock ( "@src/app/_components/nhs-frontend/BackLink" , ( ) =>
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import { VaccineTypes } from "@src/models/vaccine";
66import VaccineMenACWY from "@src/app/vaccines/menacwy/page" ;
77import { assertBackLinkIsPresent } from "@test-data/test-helpers-back-link" ;
88
9- jest . mock ( "next/navigation" , ( ) => ( {
10- useRouter : jest . fn ( ) ,
11- } ) ) ;
129jest . mock ( "@src/services/content-api/gateway/content-reader-service" ) ;
1310jest . mock ( "@src/app/_components/vaccine/Vaccine" ) ;
1411jest . mock ( "@src/app/_components/nhs-frontend/BackLink" , ( ) =>
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import { VaccineTypes } from "@src/models/vaccine";
66import VaccinePneumococcal from "@src/app/vaccines/pneumococcal/page" ;
77import { assertBackLinkIsPresent } from "@test-data/test-helpers-back-link" ;
88
9- jest . mock ( "next/navigation" , ( ) => ( {
10- useRouter : jest . fn ( ) ,
11- } ) ) ;
129jest . mock ( "@src/services/content-api/gateway/content-reader-service" ) ;
1310jest . mock ( "@src/app/_components/vaccine/Vaccine" ) ;
1411jest . mock ( "@src/app/_components/nhs-frontend/BackLink" , ( ) =>
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import { mockStyledContent } from "@test-data/content-api/data";
66import { VaccineTypes } from "@src/models/vaccine" ;
77import { assertBackLinkIsPresent } from "@test-data/test-helpers-back-link" ;
88
9- jest . mock ( "next/navigation" , ( ) => ( {
10- useRouter : jest . fn ( ) ,
11- } ) ) ;
129jest . mock ( "@src/services/content-api/gateway/content-reader-service" ) ;
1310jest . mock ( "@src/app/_components/vaccine/Vaccine" , ( ) => jest . fn ( ( ) => < div /> ) ) ;
1411jest . mock ( "@src/app/_components/nhs-frontend/BackLink" , ( ) =>
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import { VaccineTypes } from "@src/models/vaccine";
66import VaccineShingles from "@src/app/vaccines/shingles/page" ;
77import { assertBackLinkIsPresent } from "@test-data/test-helpers-back-link" ;
88
9- jest . mock ( "next/navigation" , ( ) => ( {
10- useRouter : jest . fn ( ) ,
11- } ) ) ;
129jest . mock ( "@src/services/content-api/gateway/content-reader-service" ) ;
1310jest . mock ( "@src/app/_components/vaccine/Vaccine" ) ;
1411jest . mock ( "@src/app/_components/nhs-frontend/BackLink" , ( ) =>
You can’t perform that action at this time.
0 commit comments