From a08207fe415142e0524f6379fbddaea6bc611e99 Mon Sep 17 00:00:00 2001 From: Anton Platonov Date: Fri, 21 Feb 2020 13:42:57 +0200 Subject: [PATCH] test(router): matching child not under first parent Fixes #307 --- test/router/parent-layouts.spec.html | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/router/parent-layouts.spec.html b/test/router/parent-layouts.spec.html index a1959279..b86d6715 100644 --- a/test/router/parent-layouts.spec.html +++ b/test/router/parent-layouts.spec.html @@ -208,6 +208,30 @@ checkOutlet(['x-fallback']); }); + it('should render the matching child route even if it is not under the first matching parent', async() => { + router.setRoutes([ + { + path: '/', + component: 'x-layout-a', + children: [ + {path: '/a', component: 'x-a'}, + ] + }, + { + path: '/', + component: 'x-layout-b', + children: [ + {path: '/b', component: 'x-b'} + ] + }, + ]); + + await router.render('/b'); + + verifyActiveRoutes(router, ['/', '/b']); + checkOutlet(['x-layout-b', 'x-b']); + }); + it('redirect property amends previous path', async() => { router.setRoutes([ {path: '/a', component: 'x-a', children: [