Skip to content

Commit 61c3655

Browse files
committed
DrugChartSlider tests updates
1 parent 69781d8 commit 61c3655

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

src/features/DrugChartSlider/tests/DrugDetails.spec.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import { render } from "@testing-library/react";
3+
import { IntlProvider } from "react-intl";
34
import { DrugDetails } from "../components/DrugDetails";
45

56
const mockHostData = {
@@ -18,7 +19,11 @@ const mockHostData = {
1819

1920
describe("DrugDetails", () => {
2021
it("should match snapshot", () => {
21-
const { container } = render(<DrugDetails hostData={mockHostData} />);
22+
const { container } = render(
23+
<IntlProvider locale="en">
24+
<DrugDetails hostData={mockHostData} />
25+
</IntlProvider>
26+
);
2227
expect(container).toMatchSnapshot();
2328
});
2429
});

src/features/DrugChartSlider/tests/DrugInstructions.spec.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import { render } from "@testing-library/react";
3+
import { IntlProvider } from "react-intl";
34
import { DrugInstructions } from "../components/DrugInstructions";
45

56
const mockHostData = {
@@ -11,7 +12,11 @@ const mockHostData = {
1112

1213
describe("DrugInstructions", () => {
1314
it("should match snapshot", () => {
14-
const { container } = render(<DrugInstructions hostData={mockHostData} />);
15+
const { container } = render(
16+
<IntlProvider locale="en">
17+
<DrugInstructions hostData={mockHostData} />
18+
</IntlProvider>
19+
);
1520
expect(container).toMatchSnapshot();
1621
});
1722
});

src/features/DrugChartSlider/tests/ScheduleSection.spec.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import { render, waitFor } from "@testing-library/react";
3+
import { IntlProvider } from "react-intl";
34
import { ScheduleSection } from "../components/ScheduleSection"; // Replace 'YourComponent' with the actual file name
45

56
describe("ScheduleSection", () => {
@@ -24,15 +25,21 @@ describe("ScheduleSection", () => {
2425
};
2526

2627
it("renders ScheduleSection component when firstday slots are missed", async () => {
27-
const { container } = render(<ScheduleSection {...props} />);
28+
const { container } = render(
29+
<IntlProvider locale="en">
30+
<ScheduleSection {...props} />
31+
</IntlProvider>
32+
);
2833

2934
await waitFor(() => {
3035
expect(container).toMatchSnapshot();
3136
});
3237
});
3338
it("renders ScheduleSection component when firstday slots missed is 0", async () => {
3439
const { container } = render(
35-
<ScheduleSection {...props} firstDaySlotsMissed={0} />
40+
<IntlProvider locale="en">
41+
<ScheduleSection {...props} firstDaySlotsMissed={0} />
42+
</IntlProvider>
3643
);
3744

3845
await waitFor(() => {

0 commit comments

Comments
 (0)