From 91772456df5af15aab53ca72993d01ae7ecc2aa8 Mon Sep 17 00:00:00 2001 From: "zokutyou2@gmail.com" Date: Tue, 13 Jul 2021 22:13:07 +0900 Subject: [PATCH] update test --- web/src/js/__tests__/components/Command/CommandSpec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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