Skip to content

Commit aab8978

Browse files
committed
add home page tests
1 parent d315fd0 commit aab8978

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/routes/Home/index.test.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { render, screen } from "@testing-library/react";
2+
import Home from "./index.tsx";
3+
4+
describe("Home", () => {
5+
const setup = () => {
6+
render(<Home />);
7+
};
8+
9+
it("renders the Hero content", () => {
10+
setup();
11+
12+
expect(screen.getByText("Where Code Meets Community")).toBeInTheDocument();
13+
expect(screen.getByRole("button", { name: "Join us" })).toBeInTheDocument();
14+
});
15+
16+
it("renders the Features content", () => {
17+
setup();
18+
19+
expect(screen.getByText("Active Community")).toBeInTheDocument();
20+
expect(
21+
screen.getByText(/Connect with like-minded developers/),
22+
).toBeInTheDocument();
23+
});
24+
25+
it("renders the Showcase content", () => {
26+
setup();
27+
28+
expect(screen.getByText("Community Showcase")).toBeInTheDocument();
29+
});
30+
31+
it("renders the CTA content", () => {
32+
setup();
33+
34+
expect(
35+
screen.getByText("Ready to Join Our Community?"),
36+
).toBeInTheDocument();
37+
expect(
38+
screen.getByRole("link", { name: "Join Code Cafe" }),
39+
).toBeInTheDocument();
40+
});
41+
});

0 commit comments

Comments
 (0)