diff --git a/web/src/js/__tests__/components/Command/CommandSpec.js b/web/src/js/__tests__/components/Command/CommandSpec.js index fbc75d65e..7cb101dbb 100644 --- a/web/src/js/__tests__/components/Command/CommandSpec.js +++ b/web/src/js/__tests__/components/Command/CommandSpec.js @@ -2,6 +2,7 @@ import React from 'react' import CommandBar from '../../../components/CommandBar' import { render } from "../../test-utils" import fetchMock from 'fetch-mock'; +import { act, waitFor } from '@testing-library/react' test('CommandBar Component', async () => { fetchMock.get('./commands.json', {status: 200, body: {"commands": "foo"}}) @@ -9,5 +10,7 @@ test('CommandBar Component', async () => { const {asFragment, store} = render( ); - expect(asFragment()).toMatchSnapshot(); + await waitFor(() => { + expect(asFragment()).toMatchSnapshot(); + }); }) \ No newline at end of file