From: Eduardo San Martin Morote Date: Mon, 6 May 2019 16:18:22 +0000 (+0200) Subject: test: matcher nested record X-Git-Tag: v4.0.0-alpha.0~384 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5ff80644fe3020116f6d150a6fa49a394f64dd7;p=thirdparty%2Fvuejs%2Frouter.git test: matcher nested record --- diff --git a/__tests__/matcher.spec.js b/__tests__/matcher.spec.js index 6907b15e..97f1f111 100644 --- a/__tests__/matcher.spec.js +++ b/__tests__/matcher.spec.js @@ -604,6 +604,37 @@ describe('Router Matcher', () => { } ) }) + + it('resolves nested children with params with named location', () => { + const Foo = { + path: '/foo', + name: 'Foo', + component, + children: [NestedWithParam], + } + assertRecordMatch( + Foo, + { name: 'nested-child-params', params: { p: 'a', n: 'b' } }, + { + name: 'nested-child-params', + path: '/foo/nested/b/a', + params: { p: 'a', n: 'b' }, + matched: [ + Foo, + { + ...NestedWithParam, + path: `${Foo.path}/${NestedWithParam.path}`, + }, + { + ...NestedChildWithParam, + path: `${Foo.path}/${NestedWithParam.path}/${ + NestedChildWithParam.path + }`, + }, + ], + } + ) + }) }) }) })