Skip to content

Commit 7730d0c

Browse files
committed
flush pending promises in test file
1 parent 4ed8ee8 commit 7730d0c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/containers/shared/components/TokenSearchResults/test/TokenSearchResults.test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import testTokens from './mock_data/tokens.json'
55
import SocketContext from '../../../SocketContext'
66
import SearchResults from '../TokenSearchResults'
77
import MockWsClient from '../../../../test/mockWsClient'
8-
import { QuickHarness } from '../../../../test/utils'
8+
import { QuickHarness, flushPromises } from '../../../../test/utils'
99

1010
const testQuery = 'test'
1111

@@ -43,14 +43,18 @@ describe('Testing tokens search', () => {
4343
wrapper.unmount()
4444
})
4545

46-
it('renders without crashing', () => {
46+
it('renders without crashing', async () => {
47+
await flushPromises()
4748
wrapper.update()
49+
4850
const searchMenu = wrapper.find('.search-results-menu')
4951
expect(searchMenu.length).toEqual(1)
5052
})
5153

52-
it('renders all tokens ', () => {
54+
it('renders all tokens ', async () => {
55+
await flushPromises()
5356
wrapper.update()
57+
5458
const searchMenu = wrapper.find('.search-results-menu')
5559

5660
expect(searchMenu.find('.search-results-header').at(0).html()).toEqual(

0 commit comments

Comments
 (0)