Skip to content

Commit

Permalink
project.test.js: Attempt to fix resource leak by waiting for renderin…
Browse files Browse the repository at this point in the history
…g to finish

Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed May 31, 2023
1 parent 27e75d0 commit e9c741a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontend/src/views/tests/project.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ test('CreateProject renders ProjectCreate', async () => {
</QueryParamProvider>,
);
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', () => {
Expand Down

0 comments on commit e9c741a

Please sign in to comment.