Skip to content

Commit

Permalink
chore: refactors tests (#709)
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony D. Mays <[email protected]>
  • Loading branch information
anthonydmays authored Jan 6, 2025
1 parent b6f629d commit 1995bdb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import { TodoApp } from './todo-app';
describe('TodoApp', () => {
beforeEach(() => {
fetchMock.resetMocks();
});

test('initializes correctly', async () => {
// Arrange
fetchMock.mockResponseIf(
new URL('/api/todos', process.env.NEXT_PUBLIC_API_URL).toString(),
JSON.stringify([
{ id: 1, text: 'Todo 1', completed: false },
{ id: 2, text: 'Todo 2', completed: true },
] as Todo[]),
);
});

test('initializes correctly', async () => {
// Act
render(<TodoApp />);

Expand Down

0 comments on commit 1995bdb

Please sign in to comment.