Skip to content

Commit edc76b7

Browse files
VIA-629 AJ/EO Vaccine component to pass campaign info to MoreInformation
1 parent 96e8b1c commit edc76b7

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/app/_components/content/MoreInformation.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ describe("MoreInformation component for COVID", () => {
3434
});
3535

3636
describe("MoreInformation component ", () => {
37-
3837
describe("When vaccineInfo.moreInformationHeadersFromContentApi=false", () => {
3938
it("should display whatItIsFor expander block", async () => {
4039
const vaccineType = VaccineType.RSV;

src/app/_components/vaccine/Vaccine.integration.test.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { mockNHSAppJSFunctions } from "@src/utils/nhsapp-js.test";
77
import { ConfigMock, configBuilder } from "@test-data/config/builders";
88
import { eligibilityApiResponseBuilder } from "@test-data/eligibility-api/builders";
99
import { render, screen } from "@testing-library/react";
10-
import { ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers";
11-
import { headers } from "next/headers";
1210

1311
jest.mock("@src/utils/auth/generate-auth-payload", () => jest.fn());
1412
jest.mock("@src/services/eligibility-api/gateway/fetch-eligibility-content", () => ({
@@ -45,6 +43,7 @@ const nhsNumber = "5123456789";
4543

4644
describe("Vaccine", () => {
4745
const mockedConfig = config as ConfigMock;
46+
4847
beforeAll(() => {
4948
const defaultConfig = configBuilder().withContentCachePath("wiremock/__files/").withPinoLogLevel("info").build();
5049
Object.assign(mockedConfig, defaultConfig);
@@ -55,12 +54,6 @@ describe("Vaccine", () => {
5554
nhs_number: nhsNumber,
5655
},
5756
});
58-
const fakeHeaders: ReadonlyHeaders = {
59-
get(name: string): string | null {
60-
return `fake-${name}-header`;
61-
},
62-
} as ReadonlyHeaders;
63-
(headers as jest.Mock).mockResolvedValue(fakeHeaders);
6457
});
6558

6659
it.each([VaccineType.RSV, VaccineType.RSV_PREGNANCY])(

src/app/_components/vaccine/Vaccine.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ const VaccineComponent = async ({ vaccineType }: VaccineProps): Promise<JSX.Elem
104104
<h2 className="nhsuk-heading-s">{`More information about the ${vaccineInfo.displayName.midSentenceCase} ${vaccineInfo.displayName.suffix}`}</h2>
105105
{/* Expandable sections */}
106106
{contentError != ContentErrorTypes.CONTENT_LOADING_ERROR && styledVaccineContent != undefined ? (
107-
<MoreInformation styledVaccineContent={styledVaccineContent} vaccineType={vaccineType} />
107+
<MoreInformation
108+
styledVaccineContent={styledVaccineContent}
109+
vaccineType={vaccineType}
110+
isCampaignActive={isCampaignActive}
111+
/>
108112
) : (
109113
<FindOutMoreLink findOutMoreUrl={vaccineInfo.nhsWebpageLink} vaccineType={vaccineType} />
110114
)}

0 commit comments

Comments
 (0)