File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ export function addNavGuards (rootVm) {
19
19
} )
20
20
21
21
router . afterEach ( ( ) => {
22
- const { metaInfo } = resume ( rootVm )
22
+ rootVm . $nextTick ( ( ) => {
23
+ const { metaInfo } = resume ( rootVm )
23
24
24
- if ( metaInfo && isFunction ( metaInfo . afterNavigation ) ) {
25
- metaInfo . afterNavigation ( metaInfo )
26
- }
25
+ if ( metaInfo && isFunction ( metaInfo . afterNavigation ) ) {
26
+ metaInfo . afterNavigation ( metaInfo )
27
+ }
28
+ } )
27
29
} )
28
30
}
Original file line number Diff line number Diff line change @@ -271,6 +271,8 @@ describe('components', () => {
271
271
expect ( wrapper . vm . $root . _vueMeta . pausing ) . toBe ( true )
272
272
273
273
guards . after ( )
274
+ expect ( afterNavigation ) . not . toHaveBeenCalled ( )
275
+ await vmTick ( wrapper . vm )
274
276
expect ( afterNavigation ) . toHaveBeenCalled ( )
275
277
} )
276
278
@@ -306,6 +308,8 @@ describe('components', () => {
306
308
expect ( wrapper . vm . $root . _vueMeta . pausing ) . toBe ( true )
307
309
308
310
guards . after ( )
311
+ expect ( afterNavigation ) . not . toHaveBeenCalled ( )
312
+ await vmTick ( wrapper . vm )
309
313
expect ( afterNavigation ) . toHaveBeenCalled ( )
310
314
} )
311
315
You can’t perform that action at this time.
0 commit comments