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 <tsmock@meta.com>
  • Loading branch information
tsmock committed Jun 7, 2023
1 parent 8744a3c commit cd758ca
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 cd758ca

Please sign in to comment.