From cd758ca2ab284e5f3c7ee704fc771a28df6d4e91 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Wed, 31 May 2023 06:46:33 -0600 Subject: [PATCH] project.test.js: Attempt to fix resource leak by waiting for rendering to finish Signed-off-by: Taylor Smock --- frontend/src/views/tests/project.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/views/tests/project.test.js b/frontend/src/views/tests/project.test.js index 6604303f5a..383dcf9527 100644 --- a/frontend/src/views/tests/project.test.js +++ b/frontend/src/views/tests/project.test.js @@ -32,6 +32,13 @@ test('CreateProject renders ProjectCreate', async () => { , ); expect(screen.getByText('Loading...')).toBeInTheDocument(); + await waitFor(() => expect(screen.queryByText('Loading...')).not.toBeInTheDocument()); + // Since WebGL is not supported by Node, we'll assume that the map context will be loaded + // If WebGL was supported by Node, we could look for `Step 1: define area` instead. + expect( + await screen.findByRole('heading', { name: 'WebGL Context Not Found' }), + ).toBeInTheDocument(); + expect(screen.getByRole('link', { name: 'WebGL is enabled' })).toBeInTheDocument(); }); describe('UserProjectsPage Component', () => {