]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: fix missing props
authorEduardo San Martin Morote <posva13@gmail.com>
Sun, 15 Mar 2020 23:16:40 +0000 (00:16 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Sun, 15 Mar 2020 23:16:40 +0000 (00:16 +0100)
__tests__/matcher/records.spec.ts
__tests__/router.spec.ts
playground/views/ComponentWithData.vue

index 0c90225d9ab26b7dd2baa71bff80778889ae29ea..0c07886164e8aff28eba3aa4e835206a5b18c0cd 100644 (file)
@@ -15,6 +15,7 @@ describe('normalizeRouteRecord', () => {
       meta: {},
       name: undefined,
       path: '/home',
+      props: false,
     })
   })
 
@@ -36,6 +37,7 @@ describe('normalizeRouteRecord', () => {
       meta: { foo: true },
       name: 'name',
       path: '/home',
+      props: false,
     })
   })
 
@@ -56,6 +58,7 @@ describe('normalizeRouteRecord', () => {
       meta: { foo: true },
       name: 'name',
       path: '/redirect',
+      props: false,
     })
   })
 
@@ -77,6 +80,7 @@ describe('normalizeRouteRecord', () => {
       meta: { foo: true },
       name: 'name',
       path: '/home',
+      props: false,
     })
   })
 
@@ -94,6 +98,7 @@ describe('normalizeRouteRecord', () => {
       meta: {},
       name: undefined,
       path: '/redirect',
+      props: false,
     })
   })
 
index 2998d1017a0fd2e3f2be376675defac394932885..4e3bd4d95b1f67c410af0a20bf569231327ce743 100644 (file)
@@ -368,7 +368,7 @@ describe('Router', () => {
   it('allows base option in abstract history', async () => {
     const history = createMemoryHistory('/app/')
     const router = createRouter({ history, routes })
-    expect(router.currentRoute.value).toEqual({
+    expect(router.currentRoute.value).toMatchObject({
       name: undefined,
       fullPath: '/',
       hash: '',
@@ -391,7 +391,7 @@ describe('Router', () => {
   it('allows base option with html5 history', async () => {
     const history = createWebHistory('/app/')
     const router = createRouter({ history, routes })
-    expect(router.currentRoute.value).toEqual({
+    expect(router.currentRoute.value).toMatchObject({
       name: undefined,
       fullPath: '/',
       hash: '',
index 857018b080cc958f26c39426ffbefae1647d6b77..b5b1d5d148d488985660e63cceff636e3fc34948 100644 (file)
@@ -15,6 +15,8 @@ export default defineComponent({
     const data = reactive({ other: null })
     data.fromApi = await getData()
 
+    // TODO: add sample with onBeforeRouteUpdate()
+
     return {
       ...toRefs(data),
     }