File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ describe('Find composition', () => {
319
319
expect ( findComposition && findComposition . data . value ) . toContainEqual ( changedTestModel ) ;
320
320
} ) ;
321
321
322
- it ( 'should listen to "patch" & "update" events when query is matching' , ( ) => {
322
+ it ( 'should listen to "patch" & "update" events when query is matching' , async ( ) => {
323
323
expect . assertions ( 2 ) ;
324
324
325
325
// given
@@ -336,15 +336,16 @@ describe('Find composition', () => {
336
336
const useFind = useFindOriginal ( feathersMock ) ;
337
337
let findComposition = null as UseFind < TestModel > | null ;
338
338
mountComposition ( ( ) => {
339
- findComposition = useFind ( 'testModels' , ref ( { query : { mood : 'please-do-not-match' } } ) ) ;
339
+ findComposition = useFind ( 'testModels' , ref ( { query : { mood : changedTestModel . mood } } ) ) ;
340
340
} ) ;
341
+ await nextTick ( ) ;
341
342
342
343
// when
343
344
emitter . emit ( 'updated' , changedTestModel ) ;
344
345
345
346
// then
346
347
expect ( findComposition ) . toBeTruthy ( ) ;
347
- expect ( findComposition && findComposition . data . value ) . not . toContainEqual ( changedTestModel ) ;
348
+ expect ( findComposition && findComposition . data . value ) . toContainEqual ( changedTestModel ) ;
348
349
} ) ;
349
350
350
351
it ( 'should ignore "patch" & "update" events when query is not matching' , async ( ) => {
You can’t perform that action at this time.
0 commit comments