File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -35,28 +35,28 @@ describe('List Component', () => {
35
35
} ) ;
36
36
} ) ;
37
37
38
- test ( 'shows welcome message and AddItems component when no items are present ' , ( ) => {
38
+ test ( 'shows AddItems component with existing items' , ( ) => {
39
39
render (
40
40
< MemoryRouter >
41
- < List data = { [ ] } listPath = { '/groceries' } />
41
+ < List data = { mockShoppingListData } listPath = { '/groceries' } />
42
42
</ MemoryRouter > ,
43
43
) ;
44
44
45
- expect ( screen . getByText ( 'Welcome to groceries!' ) ) . toBeInTheDocument ( ) ;
46
45
expect ( screen . getByLabelText ( 'Item Name:' ) ) . toBeInTheDocument ( ) ;
47
46
expect ( screen . getByLabelText ( 'Soon' ) ) . toBeInTheDocument ( ) ;
48
47
expect ( screen . getByLabelText ( 'Kind of soon' ) ) . toBeInTheDocument ( ) ;
49
48
expect ( screen . getByLabelText ( 'Not soon' ) ) . toBeInTheDocument ( ) ;
50
49
expect ( screen . getByText ( 'Submit' ) ) . toBeInTheDocument ( ) ;
51
50
} ) ;
52
51
53
- test ( 'shows AddItems component with existing items' , ( ) => {
52
+ test ( 'shows welcome message and AddItems component when no items are present ' , ( ) => {
54
53
render (
55
54
< MemoryRouter >
56
- < List data = { mockShoppingListData } listPath = { '/groceries' } />
55
+ < List data = { [ ] } listPath = { '/groceries' } />
57
56
</ MemoryRouter > ,
58
57
) ;
59
58
59
+ expect ( screen . getByText ( 'Welcome to groceries!' ) ) . toBeInTheDocument ( ) ;
60
60
expect ( screen . getByLabelText ( 'Item Name:' ) ) . toBeInTheDocument ( ) ;
61
61
expect ( screen . getByLabelText ( 'Soon' ) ) . toBeInTheDocument ( ) ;
62
62
expect ( screen . getByLabelText ( 'Kind of soon' ) ) . toBeInTheDocument ( ) ;
You can’t perform that action at this time.
0 commit comments