File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
tests/jest/view/plugin/search Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -71,19 +71,23 @@ describe('Search plugin', () => {
71
71
const input = wrapper . find ( 'input' ) ;
72
72
const onInput = input . props ( ) . onInput ;
73
73
74
- act ( ( ) => {
74
+ await act ( ( ) => {
75
75
const htmlInputElement = document . createElement ( 'input' ) ;
76
76
htmlInputElement . value = '123' ;
77
77
onInput ( { target : htmlInputElement } ) ;
78
78
} ) ;
79
79
80
80
wrapper . update ( ) ;
81
81
82
- await flushPromises ( ) ;
83
- await flushPromises ( ) ;
84
82
await flushPromises ( ) ;
85
83
86
- expect ( mock ) . toBeCalledWith ( '123' ) ;
84
+ return new Promise < void > ( ( resolve ) => {
85
+ // TODO: can we fix this and remove the setTimeout?
86
+ setTimeout ( ( ) => {
87
+ expect ( mock ) . toBeCalledWith ( '123' ) ;
88
+ resolve ( ) ;
89
+ } , 100 ) ;
90
+ } ) ;
87
91
} ) ;
88
92
89
93
it ( 'should add config.className.search' , async ( ) => {
You can’t perform that action at this time.
0 commit comments