From 67a1426b0c99d0d38763c57ec0579a1d61dad1d6 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 29 Apr 2020 16:10:33 +0200 Subject: [PATCH] chore: remove outdated TODO --- __tests__/RouterView.spec.ts | 9 +++++++-- __tests__/history/hash.spec.ts | 2 -- __tests__/matcher/pathParser.spec.ts | 8 -------- __tests__/matcher/pathRanking.spec.ts | 2 +- __tests__/mount.ts | 4 +--- e2e/scroll-behavior/index.ts | 3 +-- playground/views/ComponentWithData.vue | 8 ++++++-- playground/views/User.vue | 5 ++--- src/RouterLink.ts | 10 ++++------ src/history/memory.ts | 2 -- src/install.ts | 1 - src/matcher/index.ts | 2 -- src/matcher/pathMatcher.ts | 1 - src/matcher/pathTokenizer.ts | 3 --- src/router.ts | 23 ++++++++++++----------- src/types/index.ts | 6 ++---- 16 files changed, 36 insertions(+), 53 deletions(-) diff --git a/__tests__/RouterView.spec.ts b/__tests__/RouterView.spec.ts index 08a53a66..b7e16391 100644 --- a/__tests__/RouterView.spec.ts +++ b/__tests__/RouterView.spec.ts @@ -196,10 +196,15 @@ describe('RouterView', () => { }) it('does not pass params as props by default', async () => { - // TODO: rewrite so it is by default instead of explicitly stated let noPropsWithParams = { ...routes.withParams, - matched: [{ ...routes.withParams.matched[0], props: false }], + matched: [ + { + components: { default: components.User }, + instances: {}, + path: '/users/:id', + }, + ], } const { wrapper, route } = await factory(noPropsWithParams) expect(wrapper.html()).toBe(`
User: default
`) diff --git a/__tests__/history/hash.spec.ts b/__tests__/history/hash.spec.ts index 5f3fbdbc..765b23f6 100644 --- a/__tests__/history/hash.spec.ts +++ b/__tests__/history/hash.spec.ts @@ -80,7 +80,5 @@ describe('History Hash', () => { expect.stringMatching(/^#\/?$/) ) }) - - it.todo('warns if we provide a base with file://') }) }) diff --git a/__tests__/matcher/pathParser.spec.ts b/__tests__/matcher/pathParser.spec.ts index 6225d6c1..2d5d1810 100644 --- a/__tests__/matcher/pathParser.spec.ts +++ b/__tests__/matcher/pathParser.spec.ts @@ -9,14 +9,6 @@ describe('Path parser', () => { ]) }) - // TODO: refactor trailing slash cases - it.skip('trailing slash', () => { - expect(tokenizePath('/foo/')).toEqual([ - [{ type: TokenType.Static, value: 'foo' }], - [{ type: TokenType.Static, value: '' }], - ]) - }) - it('empty', () => { expect(tokenizePath('')).toEqual([[]]) }) diff --git a/__tests__/matcher/pathRanking.spec.ts b/__tests__/matcher/pathRanking.spec.ts index f437fed0..86e9151a 100644 --- a/__tests__/matcher/pathRanking.spec.ts +++ b/__tests__/matcher/pathRanking.spec.ts @@ -38,7 +38,7 @@ describe('Path ranking', () => { }) it('longer', () => { expect(compare([[2]], [[3, 1]])).toEqual(1) - // TODO: we are assuming we never pass end: false + // NOTE: we are assuming we never pass end: false expect(compare([[3]], [[3, 1]])).toEqual(1) expect(compare([[1, 3]], [[2]])).toEqual(1) expect(compare([[4]], [[3]])).toEqual(-1) diff --git a/__tests__/mount.ts b/__tests__/mount.ts index 46091bc2..8e460a4b 100644 --- a/__tests__/mount.ts +++ b/__tests__/mount.ts @@ -41,7 +41,6 @@ function initialProps

(propsOption: ComponentObjectPropsOptions

) { const prop = propsOption[key]! // @ts-ignore if (!prop.required && prop.default) - // TODO: function value // @ts-ignore copy[key] = prop.default } @@ -57,7 +56,6 @@ afterAll(() => { }) export function mount( - // TODO: generic? targetComponent: Parameters[0], options: Partial = {} ): Promise { @@ -124,7 +122,6 @@ export function mount( } } - // TODO: how to cleanup? const rootEl = document.createElement('div') document.body.appendChild(rootEl) @@ -140,6 +137,7 @@ export function mount( activeWrapperRemovers.push(() => { app.unmount(rootEl) + rootEl.remove() }) }) } diff --git a/e2e/scroll-behavior/index.ts b/e2e/scroll-behavior/index.ts index dbafb0a2..5ba37ef5 100644 --- a/e2e/scroll-behavior/index.ts +++ b/e2e/scroll-behavior/index.ts @@ -40,8 +40,7 @@ const scrollBehavior: ScrollBehavior = async function ( // specify offset of the element if (to.hash === '#anchor2') { - // TODO: allow partial { y: 100 } - position.offset = { x: 0, y: 100 } + position.offset = { y: 100 } } // bypass #1number check diff --git a/playground/views/ComponentWithData.vue b/playground/views/ComponentWithData.vue index a1598ac8..9a989f14 100644 --- a/playground/views/ComponentWithData.vue +++ b/playground/views/ComponentWithData.vue @@ -8,14 +8,18 @@