Skip to content

Commit 39e2433

Browse files
author
Nika Kolesnikova
committed
fix: update List test
1 parent 73eedc4 commit 39e2433

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/List.test.jsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@ describe('List Component', () => {
3535
});
3636
});
3737

38-
test('shows welcome message and AddItems component when no items are present', () => {
38+
test('shows AddItems component with existing items', () => {
3939
render(
4040
<MemoryRouter>
41-
<List data={[]} listPath={'/groceries'} />
41+
<List data={mockShoppingListData} listPath={'/groceries'} />
4242
</MemoryRouter>,
4343
);
4444

45-
expect(screen.getByText('Welcome to groceries!')).toBeInTheDocument();
4645
expect(screen.getByLabelText('Item Name:')).toBeInTheDocument();
4746
expect(screen.getByLabelText('Soon')).toBeInTheDocument();
4847
expect(screen.getByLabelText('Kind of soon')).toBeInTheDocument();
4948
expect(screen.getByLabelText('Not soon')).toBeInTheDocument();
5049
expect(screen.getByText('Submit')).toBeInTheDocument();
5150
});
5251

53-
test('shows AddItems component with existing items', () => {
52+
test('shows welcome message and AddItems component when no items are present', () => {
5453
render(
5554
<MemoryRouter>
56-
<List data={mockShoppingListData} listPath={'/groceries'} />
55+
<List data={[]} listPath={'/groceries'} />
5756
</MemoryRouter>,
5857
);
5958

59+
expect(screen.getByText('Welcome to groceries!')).toBeInTheDocument();
6060
expect(screen.getByLabelText('Item Name:')).toBeInTheDocument();
6161
expect(screen.getByLabelText('Soon')).toBeInTheDocument();
6262
expect(screen.getByLabelText('Kind of soon')).toBeInTheDocument();

0 commit comments

Comments
 (0)