Skip to content

Commit dbb0e5f

Browse files
committed
feat: add more test for testimonials component
1 parent 94d88f2 commit dbb0e5f

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed
Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
import "@testing-library/jest-dom";
2-
import { screen } from "@testing-library/react";
3-
import { renderWithRedux } from "../../../../__mocks__/renderWithRedux";
1+
import { render, screen } from "@testing-library/react";
42
import TestimonialsSection from "@/components/sections/homepage/Testimonials";
53

6-
describe("OpenSource", () => {
7-
it("should render Open Source", () => {
8-
renderWithRedux(<TestimonialsSection/>)
9-
expect(screen.getByText("testimonials.community.title")).toBeInTheDocument()
10-
expect(screen.getByText("footer.open.source")).toBeInTheDocument()
11-
})
12-
});
4+
describe("Testimonials Section", () => {
5+
const testimonials = [
6+
{
7+
icon: "/assets/img/testimonials/CED.jpg",
8+
content:
9+
"Dacade helped me to meet people on the same blockchain journey as me and gives access to cool mentors! I like that it rewards you for challenges and helping others.",
10+
},
11+
{
12+
icon: "/assets/img/testimonials/alex.jpg",
13+
content: "Testimonials text",
14+
},
15+
];
16+
17+
it("should render testimonials with correct content", () => {
18+
render(<TestimonialsSection />);
19+
expect(screen.getByText("testimonials.community.title")).toBeInTheDocument();
20+
expect(screen.getByText("footer.open.source")).toBeInTheDocument();
21+
22+
testimonials.forEach((testimonial) => {
23+
expect(screen.getByAltText(testimonial.icon)).toBeInTheDocument();
24+
expect(screen.getByText(testimonial.content)).toBeInTheDocument();
25+
});
26+
});
27+
});

0 commit comments

Comments
 (0)