From 082e421b5d24bd5265b3cf2b5a2e9cb15989417b Mon Sep 17 00:00:00 2001 From: uuoocckk-983 <799754081@qq.com> Date: Thu, 16 Jul 2020 18:13:02 +0800 Subject: [PATCH] test(__tests__/RouterLink.spec): add not match repeated params test (#373) * test(__tests__/RouterLink.spec): add not match repeated params test * Update __tests__/RouterLink.spec.ts [skip ci] Co-authored-by: Eduardo San Martin Morote --- __tests__/RouterLink.spec.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/__tests__/RouterLink.spec.ts b/__tests__/RouterLink.spec.ts index 0372124a..5dbc426f 100644 --- a/__tests__/RouterLink.spec.ts +++ b/__tests__/RouterLink.spec.ts @@ -129,6 +129,21 @@ const locations = createLocations({ name: undefined, }, }, + anotherRepeatedParams2: { + string: '/p/1/3', + normalized: { + fullPath: '/p/1/3', + href: '/p/1/3', + path: '/p/1/3', + params: { p: ['1', '3'] }, + meta: {}, + query: {}, + hash: '', + matched: [records.home], + redirectedFrom: undefined, + name: undefined, + }, + }, repeatedParams3: { string: '/p/1/2/3', normalized: { @@ -515,6 +530,15 @@ describe('RouterLink', () => { expect(wrapper.find('a')!.className).toBe('') }) + it('is not active with different repeated params', async () => { + const { wrapper } = await factory( + locations.repeatedParams2.normalized, + { to: locations.anotherRepeatedParams2.string }, + locations.anotherRepeatedParams2.normalized + ) + expect(wrapper.find('a')!.className).toBe('') + }) + it('is not active with more repeated params', async () => { const { wrapper } = await factory( locations.repeatedParams2.normalized, -- 2.39.5