Skip to content

Commit

Permalink
fix: update List test
Browse files Browse the repository at this point in the history
  • Loading branch information
kweeuhree committed Oct 17, 2024
1 parent 73eedc4 commit 39e2433
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/List.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ describe('List Component', () => {
});
});

test('shows welcome message and AddItems component when no items are present', () => {
test('shows AddItems component with existing items', () => {
render(
<MemoryRouter>
<List data={[]} listPath={'/groceries'} />
<List data={mockShoppingListData} listPath={'/groceries'} />
</MemoryRouter>,
);

expect(screen.getByText('Welcome to groceries!')).toBeInTheDocument();
expect(screen.getByLabelText('Item Name:')).toBeInTheDocument();
expect(screen.getByLabelText('Soon')).toBeInTheDocument();
expect(screen.getByLabelText('Kind of soon')).toBeInTheDocument();
expect(screen.getByLabelText('Not soon')).toBeInTheDocument();
expect(screen.getByText('Submit')).toBeInTheDocument();
});

test('shows AddItems component with existing items', () => {
test('shows welcome message and AddItems component when no items are present', () => {
render(
<MemoryRouter>
<List data={mockShoppingListData} listPath={'/groceries'} />
<List data={[]} listPath={'/groceries'} />
</MemoryRouter>,
);

expect(screen.getByText('Welcome to groceries!')).toBeInTheDocument();
expect(screen.getByLabelText('Item Name:')).toBeInTheDocument();
expect(screen.getByLabelText('Soon')).toBeInTheDocument();
expect(screen.getByLabelText('Kind of soon')).toBeInTheDocument();
Expand Down

0 comments on commit 39e2433

Please sign in to comment.