File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
__tests__/components/cards Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments