Skip to content

Commit fa42f9a

Browse files
VIA-630 MD/DB Refactor: rename AtRiskHubContent to AtRiskHubExpander
1 parent 1bba309 commit fa42f9a

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

src/app/_components/hub/AtRiskHubContent.test.tsx renamed to src/app/_components/hub/AtRiskHubExpander.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { AtRiskHubContent } from "@src/app/_components/hub/AtRiskHubContent";
1+
import { AtRiskHubExpander } from "@src/app/_components/hub/AtRiskHubExpander";
22
import { render, screen } from "@testing-library/react";
33

44
jest.mock("@src/app/_components/hub/AtRiskText", () => ({
55
AtRiskText: jest.fn().mockImplementation(() => <p data-testid={"at-risk-text"}>At risk hub content test</p>),
66
}));
77

8-
describe("At risk hub content", () => {
8+
describe("At risk hub expander", () => {
99
beforeEach(() => {
10-
render(AtRiskHubContent());
10+
render(AtRiskHubExpander());
1111
});
1212

1313
it("should render heading as h2", () => {

src/app/_components/hub/AtRiskHubContent.tsx renamed to src/app/_components/hub/AtRiskHubExpander.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AtRiskText } from "@src/app/_components/hub/AtRiskText";
22
import React, { JSX } from "react";
33

4-
const AtRiskHubContent = (): JSX.Element => {
4+
const AtRiskHubExpander = (): JSX.Element => {
55
return (
66
<details className="nhsuk-details">
77
<summary className="nhsuk-details__summary">
@@ -16,4 +16,4 @@ const AtRiskHubContent = (): JSX.Element => {
1616
);
1717
};
1818

19-
export { AtRiskHubContent };
19+
export { AtRiskHubExpander };

src/app/check-and-book-vaccinations/page.test.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jest.mock("@src/app/_components/hub/AgeBasedHubCards", () => ({
2020
.mockImplementation(() => <p data-testid={"age-based-hub-cards"}>Age based hub cards test</p>),
2121
}));
2222

23-
jest.mock("@src/app/_components/hub/AtRiskHubContent", () => ({
24-
AtRiskHubContent: jest
23+
jest.mock("@src/app/_components/hub/AtRiskHubExpander", () => ({
24+
AtRiskHubExpander: jest
2525
.fn()
26-
.mockImplementation(() => <p data-testid={"at-risk-hub-content"}>At risk hub content test</p>),
26+
.mockImplementation(() => <p data-testid={"at-risk-hub-expander"}>At risk hub expander test</p>),
2727
}));
2828

2929
jest.mock("@src/app/_components/hub/PregnancyHubContent", () => ({
@@ -73,9 +73,8 @@ describe("Vaccination Hub Page", () => {
7373
});
7474

7575
it("should show at risk expander ", () => {
76-
const atRiskHubContent: HTMLElement = screen.getByTestId("at-risk-hub-content");
77-
78-
expect(atRiskHubContent).toBeVisible();
76+
const atRiskHubExpander: HTMLElement = screen.getByTestId("at-risk-hub-expander");
77+
expect(atRiskHubExpander).toBeVisible();
7978
});
8079

8180
it("should show pregnancy hub content ", () => {

src/app/check-and-book-vaccinations/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { auth } from "@project/auth";
44
import { AgeBasedHubCards } from "@src/app/_components/hub/AgeBasedHubCards";
5-
import { AtRiskHubContent } from "@src/app/_components/hub/AtRiskHubContent";
5+
import { AtRiskHubExpander } from "@src/app/_components/hub/AtRiskHubExpander";
66
import { PregnancyHubContent } from "@src/app/_components/hub/PregnancyHubContent";
77
import BackToNHSAppLink from "@src/app/_components/nhs-app/BackToNHSAppLink";
88
import MainContent from "@src/app/_components/nhs-frontend/MainContent";
@@ -26,7 +26,7 @@ const VaccinationsHub = async () => {
2626
<h1 className={"nhsuk-heading-xl nhsuk-u-margin-bottom-3"}>{SERVICE_HEADING}</h1>
2727
<AgeBasedHubCards ageGroup={ageGroup} />
2828
{/*TODO VIA-630 control visibility of the following components based on age*/}
29-
<AtRiskHubContent />
29+
<AtRiskHubExpander />
3030
<PregnancyHubContent />
3131
<Link href={"/vaccines-for-all-ages"} className={"nhsuk-button nhsuk-button--secondary"}>
3232
View vaccines for all ages

0 commit comments

Comments
 (0)