diff --git a/packages/router/src/__tests__/pathRanking.test.ts b/packages/router/src/__tests__/pathRanking.test.ts index 526b61e42..fe62d7c1b 100644 --- a/packages/router/src/__tests__/pathRanking.test.ts +++ b/packages/router/src/__tests__/pathRanking.test.ts @@ -24,18 +24,32 @@ describe('tokensToParser', () => { it('patch score for pageBranch which ends with empty route', () => { expect( - tokensToParser(tokenizePath('/home'), {}, { routes: [LeafPageRoute] }).score + tokensToParser( + tokenizePath('/home'), + {}, + { routes: [{ path: '/home' }, LeafPageRoute] } + ).score ).toStrictEqual([[80], [80]]); expect( - tokensToParser(tokenizePath('/:symbol'), {}, { routes: [LeafPageRoute] }) - .score + tokensToParser( + tokenizePath('/:symbol'), + {}, + { routes: [{ path: '/:symbol' }, LeafPageRoute] } + ).score ).toStrictEqual([[60], [80]]); expect( - tokensToParser(tokenizePath('/:symbol/calc'), {}, { routes: [LeafPageRoute] }) - .score + tokensToParser( + tokenizePath('/:symbol/calc'), + {}, + { routes: [{ path: '/:symbol' }, { path: '/calc' }, LeafPageRoute] } + ).score ).toStrictEqual([[60], [80], [80]]); expect( - tokensToParser(tokenizePath('/*'), {}, { routes: [LeafPageRoute] }).score + tokensToParser( + tokenizePath('/*'), + {}, + { routes: [{ path: '/*' }, LeafPageRoute] } + ).score ).toStrictEqual([[19], [80]]); }); });