Skip to content

Commit 807998e

Browse files
authored
Merge pull request #1277 from dacadeorg/test/team-challenge-test
feat: test team challenge card component
2 parents 21d1ad0 + 055a290 commit 807998e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import "@testing-library/jest-dom";
2+
import { render, screen } from "@testing-library/react";
3+
import TeamChallengeCard from "@/components/cards/TeamChallenge";
4+
5+
describe("Team challenge card component", () => {
6+
it("Should render component with default props", () => {
7+
render(<TeamChallengeCard />);
8+
expect(screen.getByText("1")).toBeInTheDocument();
9+
expect(screen.queryAllByAltText('')).not.toBe(null);
10+
});
11+
12+
it("Should render the component with given props", ()=>{
13+
render(<TeamChallengeCard index={5} title="Test title" text="test text"/>)
14+
expect(screen.getByText("5")).toBeInTheDocument()
15+
expect(screen.getByText("Test title")).toBeInTheDocument();
16+
expect(screen.getByText("test text")).toBeInTheDocument();
17+
})
18+
});

0 commit comments

Comments
 (0)