Skip to content

Commit

Permalink
add a (failing) test case for #307
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Lukashov committed Nov 27, 2018
1 parent c99fdcc commit 9b81a79
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/router/parent-layouts.spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,30 @@
checkOutlet(['x-a', 'x-b', 'x-c']);
});

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('should not render the root component, if path does not match', async() => {
router.setRoutes([
{path: '/', component: 'x-root', children: [
Expand Down

0 comments on commit 9b81a79

Please sign in to comment.