From 8e2990074984ecbdc8f1373afad26cd5400c1f9d Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 16 Mar 2020 00:16:40 +0100 Subject: [PATCH] test: fix missing props --- __tests__/matcher/records.spec.ts | 5 +++++ __tests__/router.spec.ts | 4 ++-- playground/views/ComponentWithData.vue | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/__tests__/matcher/records.spec.ts b/__tests__/matcher/records.spec.ts index 0c90225d..0c078861 100644 --- a/__tests__/matcher/records.spec.ts +++ b/__tests__/matcher/records.spec.ts @@ -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, }) }) diff --git a/__tests__/router.spec.ts b/__tests__/router.spec.ts index 2998d101..4e3bd4d9 100644 --- a/__tests__/router.spec.ts +++ b/__tests__/router.spec.ts @@ -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: '', diff --git a/playground/views/ComponentWithData.vue b/playground/views/ComponentWithData.vue index 857018b0..b5b1d5d1 100644 --- a/playground/views/ComponentWithData.vue +++ b/playground/views/ComponentWithData.vue @@ -15,6 +15,8 @@ export default defineComponent({ const data = reactive({ other: null }) data.fromApi = await getData() + // TODO: add sample with onBeforeRouteUpdate() + return { ...toRefs(data), } -- 2.39.5