From c5ff80644fe3020116f6d150a6fa49a394f64dd7 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 6 May 2019 18:18:22 +0200 Subject: [PATCH] test: matcher nested record --- __tests__/matcher.spec.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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 + }`, + }, + ], + } + ) + }) }) }) }) -- 2.47.2