Skip to content

Commit e0c9c2b

Browse files
committed
test: cleanup preparePageInfo() cases
1 parent dac2512 commit e0c9c2b

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/__tests__/connectionResolver-test.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ describe('connectionResolver', () => {
347347
});
348348

349349
describe('preparePageInfo()', () => {
350-
const edges = [
350+
const fiveEdges = [
351351
{ cursor: 1, node: 1 },
352352
{ cursor: 2, node: 2 },
353353
{ cursor: 3, node: 3 },
@@ -357,37 +357,37 @@ describe('connectionResolver', () => {
357357

358358
describe('"Relay Cursor Connections Specification (PageInfo)":', () => {
359359
describe('HasPreviousPage', () => {
360-
it('1. If last was not set, return false.', () => {
361-
expect(preparePageInfo(edges, {}, 5, 2).hasPreviousPage).toBe(false);
360+
it('If last was not set, return false.', () => {
361+
expect(preparePageInfo(fiveEdges, {}, 5, 2).hasPreviousPage).toBe(false);
362362
});
363-
it('3. If edges contains more than last elements, return true.', () => {
364-
expect(preparePageInfo(edges, { last: 3 }, 3, 2).hasPreviousPage).toBe(true);
363+
it('If edges contains more than last elements, return true.', () => {
364+
expect(preparePageInfo(fiveEdges, { last: 3 }, 3, 2).hasPreviousPage).toBe(true);
365365
});
366-
it('4. Return false', () => {
367-
expect(preparePageInfo(edges, { last: 5 }, 5, 0).hasPreviousPage).toBe(false);
366+
it('Return false', () => {
367+
expect(preparePageInfo(fiveEdges, { last: 5 }, 5, 0).hasPreviousPage).toBe(false);
368368
});
369369
});
370370

371371
describe('HasNextPage', () => {
372-
it('1. If first was not set, return false.', () => {
373-
expect(preparePageInfo(edges, {}, 4, 0).hasNextPage).toBe(false);
372+
it('If first was not set, return false.', () => {
373+
expect(preparePageInfo(fiveEdges, {}, 4, 0).hasNextPage).toBe(false);
374374
});
375-
it('3. If edges contains more than first elements, return true.', () => {
376-
expect(preparePageInfo(edges, { first: 4 }, 4, 0).hasNextPage).toBe(true);
375+
it('If edges contains more than first elements, return true.', () => {
376+
expect(preparePageInfo(fiveEdges, { first: 4 }, 4, 0).hasNextPage).toBe(true);
377377
});
378-
it('4. Return false', () => {
379-
expect(preparePageInfo(edges, { first: 5 }, 5, 0).hasNextPage).toBe(false);
378+
it('Return false', () => {
379+
expect(preparePageInfo(fiveEdges, { first: 5 }, 5, 0).hasNextPage).toBe(false);
380380
});
381381
});
382382

383383
it('should return startCursor', () => {
384-
expect(preparePageInfo(edges, {}, 4, 0).startCursor).toBe(1);
385-
expect(preparePageInfo(edges, {}, 4, 2).startCursor).toBe(1);
384+
expect(preparePageInfo(fiveEdges, {}, 4, 0).startCursor).toBe(1);
385+
expect(preparePageInfo(fiveEdges, {}, 4, 2).startCursor).toBe(1);
386386
});
387387

388388
it('should return endCursor', () => {
389-
expect(preparePageInfo(edges, {}, 4, 0).endCursor).toBe(4);
390-
expect(preparePageInfo(edges, {}, 20, 0).endCursor).toBe(5);
389+
expect(preparePageInfo(fiveEdges, {}, 4, 0).endCursor).toBe(4);
390+
expect(preparePageInfo(fiveEdges, {}, 20, 0).endCursor).toBe(5);
391391
});
392392

393393
it('should return correct values for pageInfo if last is less first', async () => {

0 commit comments

Comments
 (0)