From 19f4b8b9b47d46711dadc880598d51ccfd8b047c Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Fri, 27 Mar 2020 15:16:08 +0200 Subject: [PATCH] library url test adapted to new library url --- tests/routesRegexp.spec.js | 42 ++++++-------------------------------- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/tests/routesRegexp.spec.js b/tests/routesRegexp.spec.js index 08cdf635b..46cf9b19a 100644 --- a/tests/routesRegexp.spec.js +++ b/tests/routesRegexp.spec.js @@ -115,46 +115,16 @@ describe('routesRegexp', () => { describe('library route regexp', () => { it('match /library', async () => { expect(Array.from('/library'.match(routesRegexp.library.regexp))) - .toEqual(['/library', undefined, undefined]); + .toEqual(['/library', undefined]); }); - it('match /library/', async () => { - expect(Array.from('/library/'.match(routesRegexp.library.regexp))) - .toEqual(['/library/', '', undefined]); + it('match /library/type', async () => { + expect(Array.from('/library/type'.match(routesRegexp.library.regexp))) + .toEqual(['/library/type', 'type']); }); - it('match /library//', async () => { - expect(Array.from('/library//'.match(routesRegexp.library.regexp))) - .toEqual(['/library//', '', '']); - }); - - it('match /library/1', async () => { - expect(Array.from('/library/1'.match(routesRegexp.library.regexp))) - .toEqual(['/library/1', '1', undefined]); - }); - - it('match /library/1/', async () => { - expect(Array.from('/library/1/'.match(routesRegexp.library.regexp))) - .toEqual(['/library/1/', '1', '']); - }); - - it('match /library//2', async () => { - expect(Array.from('/library//2'.match(routesRegexp.library.regexp))) - .toEqual(['/library//2', '', '2']); - }); - - it('match /library/1/2', async () => { - expect(Array.from('/library/1/2'.match(routesRegexp.library.regexp))) - .toEqual(['/library/1/2', '1', '2']); - }); - - it('not match /library///', async () => { - expect('/library///'.match(routesRegexp.library.regexp)) - .toBe(null); - }); - - it('not match /library/1/2/', async () => { - expect('/library/1/2/'.match(routesRegexp.library.regexp)) + it('match /library/type/', async () => { + expect('/library/type/'.match(routesRegexp.library.regexp)) .toBe(null); }); });