From 1995bdb58ad51c9ec92b047343e0be9e96ca4a88 Mon Sep 17 00:00:00 2001 From: "Anthony D. Mays" Date: Mon, 6 Jan 2025 09:48:48 -0800 Subject: [PATCH] chore: refactors tests (#709) Signed-off-by: Anthony D. Mays --- .../src/components/todo-app/todo-app.spec.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/javascript/fullstack_demo/src/components/todo-app/todo-app.spec.tsx b/lib/javascript/fullstack_demo/src/components/todo-app/todo-app.spec.tsx index f01853931..e5941811f 100644 --- a/lib/javascript/fullstack_demo/src/components/todo-app/todo-app.spec.tsx +++ b/lib/javascript/fullstack_demo/src/components/todo-app/todo-app.spec.tsx @@ -6,6 +6,10 @@ 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([ @@ -13,9 +17,7 @@ describe('TodoApp', () => { { id: 2, text: 'Todo 2', completed: true }, ] as Todo[]), ); - }); - test('initializes correctly', async () => { // Act render();