player regexp tests fixed

This commit is contained in:
svetlagasheva 2020-01-22 11:47:12 +02:00
parent 05b71ed27b
commit 745347eb74

View file

@ -353,84 +353,159 @@ describe('routesRegexp', () => {
});
describe('player route regexp', () => {
it('match /player////', async () => {
expect(Array.from('/player////'.match(routesRegexp.player.regexp)))
.toEqual(['/player////', '', '', '', '']);
it('match /player/////', async () => {
expect(Array.from('/player/////'.match(routesRegexp.player.regexp)))
.toEqual(['/player/////', '', '', '', '', '']);
});
it('match /player/1///', async () => {
expect(Array.from('/player/1///'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1///', '1', '', '', '']);
it('match /player/1////', async () => {
expect(Array.from('/player/1////'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1////', '1', '', '', '', '']);
});
it('match /player//2//', async () => {
expect(Array.from('/player//2//'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2//', '', '2', '', '']);
it('match /player//2///', async () => {
expect(Array.from('/player//2///'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2///', '', '2', '', '', '']);
});
it('match /player///3/', async () => {
expect(Array.from('/player///3/'.match(routesRegexp.player.regexp)))
.toEqual(['/player///3/', '', '', '3', '']);
it('match /player///3//', async () => {
expect(Array.from('/player///3//'.match(routesRegexp.player.regexp)))
.toEqual(['/player///3//', '', '', '3', '', '']);
});
it('match /player////4', async () => {
expect(Array.from('/player////4'.match(routesRegexp.player.regexp)))
.toEqual(['/player////4', '', '', '', '4']);
it('match /player////4/', async () => {
expect(Array.from('/player////4/'.match(routesRegexp.player.regexp)))
.toEqual(['/player////4/', '', '', '', '4', '']);
});
it('match /player/1/2//', async () => {
expect(Array.from('/player/1/2//'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2//', '1', '2', '', '']);
it('match /player/////5', async () => {
expect(Array.from('/player/////5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/////5', '', '', '', '', '5']);
});
it('match /player/1//3/', async () => {
expect(Array.from('/player/1//3/'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1//3/', '1', '', '3', '']);
it('match /player/1/2///', async () => {
expect(Array.from('/player/1/2///'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2///', '1', '2', '', '', '']);
});
it('match /player/1///4', async () => {
expect(Array.from('/player/1///4'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1///4', '1', '', '', '4']);
it('match /player/1//3//', async () => {
expect(Array.from('/player/1//3//'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1//3//', '1', '', '3', '', '']);
});
it('match /player//2/3/', async () => {
expect(Array.from('/player//2/3/'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2/3/', '', '2', '3', '']);
it('match /player/1///4/', async () => {
expect(Array.from('/player/1///4/'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1///4/', '1', '', '', '4', '']);
});
it('match /player//2//4', async () => {
expect(Array.from('/player//2//4'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2//4', '', '2', '', '4']);
it('match /player/1////5', async () => {
expect(Array.from('/player/1////5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1////5', '1', '', '', '', '5']);
});
it('match /player///3/4', async () => {
expect(Array.from('/player///3/4'.match(routesRegexp.player.regexp)))
.toEqual(['/player///3/4', '', '', '3', '4']);
it('match /player//2/3//', async () => {
expect(Array.from('/player//2/3//'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2/3//', '', '2', '3', '', '']);
});
it('match /player/1/2/3/', async () => {
expect(Array.from('/player/1/2/3/'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2/3/', '1', '2', '3', '']);
it('match /player//2//4/', async () => {
expect(Array.from('/player//2//4/'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2//4/', '', '2', '', '4', '']);
});
it('match /player/1/2//4', async () => {
expect(Array.from('/player/1/2//4'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2//4', '1', '2', '', '4']);
it('match /player//2///5', async () => {
expect(Array.from('/player//2///5'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2///5', '', '2', '', '', '5']);
});
it('match /player/1//3/4', async () => {
expect(Array.from('/player/1//3/4'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1//3/4', '1', '', '3', '4']);
it('match /player///3/4/', async () => {
expect(Array.from('/player///3/4/'.match(routesRegexp.player.regexp)))
.toEqual(['/player///3/4/', '', '', '3', '4', '']);
});
it('match /player//2/3/4', async () => {
expect(Array.from('/player//2/3/4'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2/3/4', '', '2', '3', '4']);
it('match /player///3//5', async () => {
expect(Array.from('/player///3//5'.match(routesRegexp.player.regexp)))
.toEqual(['/player///3//5', '', '', '3', '', '5']);
});
it('match /player/1/2/3/4', async () => {
expect(Array.from('/player/1/2/3/4'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2/3/4', '1', '2', '3', '4']);
it('match /player////4/5', async () => {
expect(Array.from('/player////4/5'.match(routesRegexp.player.regexp)))
.toEqual(['/player////4/5', '', '', '', '4', '5']);
});
it('match /player/1/2/3//', async () => {
expect(Array.from('/player/1/2/3//'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2/3//', '1', '2', '3', '', '']);
});
it('match /player/1/2//4/', async () => {
expect(Array.from('/player/1/2//4/'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2//4/', '1', '2', '', '4', '']);
});
it('match /player/1/2///5', async () => {
expect(Array.from('/player/1/2///5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2///5', '1', '2', '', '', '5']);
});
it('match /player/1//3/4/', async () => {
expect(Array.from('/player/1//3/4/'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1//3/4/', '1', '', '3', '4', '']);
});
it('match /player/1//3//5', async () => {
expect(Array.from('/player/1//3//5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1//3//5', '1', '', '3', '', '5']);
});
it('match /player/1///4/5', async () => {
expect(Array.from('/player/1///4/5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1///4/5', '1', '', '', '4', '5']);
});
it('match /player//2/3/4/', async () => {
expect(Array.from('/player//2/3/4/'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2/3/4/', '', '2', '3', '4', '']);
});
it('match /player//2/3//5', async () => {
expect(Array.from('/player//2/3//5'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2/3//5', '', '2', '3', '', '5']);
});
it('match /player///3/4/5', async () => {
expect(Array.from('/player///3/4/5'.match(routesRegexp.player.regexp)))
.toEqual(['/player///3/4/5', '', '', '3', '4', '5']);
});
it('match /player/1/2/3/4/', async () => {
expect(Array.from('/player/1/2/3/4/'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2/3/4/', '1', '2', '3', '4', '']);
});
it('match /player/1/2/3//5', async () => {
expect(Array.from('/player/1/2/3//5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2/3//5', '1', '2', '3', '', '5']);
});
it('match /player/1/2//4/5', async () => {
expect(Array.from('/player/1/2//4/5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2//4/5', '1', '2', '', '4', '5']);
});
it('match /player/1//3/4/5', async () => {
expect(Array.from('/player/1//3/4/5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1//3/4/5', '1', '', '3', '4', '5']);
});
it('match /player//2/3/4/5', async () => {
expect(Array.from('/player//2/3/4/5'.match(routesRegexp.player.regexp)))
.toEqual(['/player//2/3/4/5', '', '2', '3', '4', '5']);
});
it('match /player/1/2/3/4/5', async () => {
expect(Array.from('/player/1/2/3/4/5'.match(routesRegexp.player.regexp)))
.toEqual(['/player/1/2/3/4/5', '1', '2', '3', '4', '5']);
});
it('not match /player', async () => {
@ -453,8 +528,8 @@ describe('routesRegexp', () => {
.toBe(null);
});
it('not match /player/////', async () => {
expect('/player/////'.match(routesRegexp.player.regexp))
it('not match /player//////', async () => {
expect('/player//////'.match(routesRegexp.player.regexp))
.toBe(null);
});
@ -473,18 +548,38 @@ describe('routesRegexp', () => {
.toBe(null);
});
it('not match /player/1///', async () => {
expect('/player/1///'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player//2', async () => {
expect('/player//2'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player//2/', async () => {
expect('/player//2/'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player//2//', async () => {
expect('/player//2//'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player///3', async () => {
expect('/player///3'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player////4/', async () => {
expect('/player////4/'.match(routesRegexp.player.regexp))
it('not match /player///3/', async () => {
expect('/player///3/'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player////4', async () => {
expect('/player////4'.match(routesRegexp.player.regexp))
.toBe(null);
});
@ -498,18 +593,48 @@ describe('routesRegexp', () => {
.toBe(null);
});
it('not match /player/1/2//', async () => {
expect('/player/1/2//'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player/1//3', async () => {
expect('/player/1//3'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player/1//3/', async () => {
expect('/player/1//3/'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player/1///4', async () => {
expect('/player/1///4'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player/1/2/3', async () => {
expect('/player/1/2/3'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player/1/2/3/4/', async () => {
expect('/player/1/2/3/4/'.match(routesRegexp.player.regexp))
it('not match /player/1/2/3/', async () => {
expect('/player/1/2/3/'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player/1/2//4', async () => {
expect('/player/1/2//4'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player/1/2/3/4', async () => {
expect('/player/1/2/3/4'.match(routesRegexp.player.regexp))
.toBe(null);
});
it('not match /player/1/2/3/4/5/', async () => {
expect('/player/1/2/3/4/5/'.match(routesRegexp.player.regexp))
.toBe(null);
});
});