Skip to content

Commit 2375aa5

Browse files
author
Nika Kolesnikova
committed
Merge branch 'nk-add-items-from-list-page'
2 parents 69c1c17 + 39e2433 commit 2375aa5

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tests/List.test.jsx

+14-14
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ describe('List Component', () => {
7373
});
7474
});
7575

76+
test('shows AddItems component with existing items', () => {
77+
render(
78+
<MemoryRouter>
79+
<List data={mockShoppingListData} listPath={'/groceries'} />
80+
</MemoryRouter>,
81+
);
82+
83+
expect(screen.getByLabelText('Item Name:')).toBeInTheDocument();
84+
expect(screen.getByLabelText('Soon')).toBeInTheDocument();
85+
expect(screen.getByLabelText('Kind of soon')).toBeInTheDocument();
86+
expect(screen.getByLabelText('Not soon')).toBeInTheDocument();
87+
expect(screen.getByText('Submit')).toBeInTheDocument();
88+
});
89+
7690
test('shows welcome message and AddItems component when no items are present', () => {
7791
render(
7892
<MemoryRouter>
@@ -108,18 +122,4 @@ describe('List Component', () => {
108122
'It seems like you landed here without first creating a list or selecting an existing one. Please select or create a new list first. Redirecting to Home.',
109123
);
110124
});
111-
112-
test('shows AddItems component with existing items', () => {
113-
render(
114-
<MemoryRouter>
115-
<List data={mockShoppingListData} listPath={'/groceries'} />
116-
</MemoryRouter>,
117-
);
118-
119-
expect(screen.getByLabelText('Item Name:')).toBeInTheDocument();
120-
expect(screen.getByLabelText('Soon')).toBeInTheDocument();
121-
expect(screen.getByLabelText('Kind of soon')).toBeInTheDocument();
122-
expect(screen.getByLabelText('Not soon')).toBeInTheDocument();
123-
expect(screen.getByText('Submit')).toBeInTheDocument();
124-
});
125125
});

0 commit comments

Comments
 (0)