2021-03-28 23:45:26 +02:00
|
|
|
import PageMapping from 'src/PageMapping';
|
|
|
|
|
|
|
|
test('1-to-1', async () => {
|
2021-03-29 08:47:04 +02:00
|
|
|
const mapping = new PageMapping(1, false);
|
|
|
|
expect(mapping.pageFactor).toEqual(1);
|
2021-03-28 23:45:26 +02:00
|
|
|
expect([...Array(3).keys()].map((i) => mapping.pageLabel(i))).toEqual(['1', '2', '3']);
|
|
|
|
});
|
|
|
|
|
2021-03-29 08:47:04 +02:00
|
|
|
test('one starter page', async () => {
|
|
|
|
const mapping = new PageMapping(0, true);
|
|
|
|
expect([...Array(5).keys()].map((i) => mapping.pageLabel(i))).toEqual(['I', '1', '2', '3', '4']);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('three starter pages', async () => {
|
|
|
|
const mapping = new PageMapping(-2, true);
|
2021-03-28 23:45:26 +02:00
|
|
|
expect([...Array(5).keys()].map((i) => mapping.pageLabel(i))).toEqual(['I', 'II', 'III', '1', '2']);
|
|
|
|
});
|