library url test adapted to new library url

This commit is contained in:
nklhrstv 2020-03-27 15:16:08 +02:00
parent f671607231
commit 19f4b8b9b4

View file

@ -115,46 +115,16 @@ describe('routesRegexp', () => {
describe('library route regexp', () => { describe('library route regexp', () => {
it('match /library', async () => { it('match /library', async () => {
expect(Array.from('/library'.match(routesRegexp.library.regexp))) expect(Array.from('/library'.match(routesRegexp.library.regexp)))
.toEqual(['/library', undefined, undefined]); .toEqual(['/library', undefined]);
}); });
it('match /library/', async () => { it('match /library/type', async () => {
expect(Array.from('/library/'.match(routesRegexp.library.regexp))) expect(Array.from('/library/type'.match(routesRegexp.library.regexp)))
.toEqual(['/library/', '', undefined]); .toEqual(['/library/type', 'type']);
}); });
it('match /library//', async () => { it('match /library/type/', async () => {
expect(Array.from('/library//'.match(routesRegexp.library.regexp))) expect('/library/type/'.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))
.toBe(null); .toBe(null);
}); });
}); });