@@ -347,7 +347,7 @@ describe('connectionResolver', () => {
347
347
} ) ;
348
348
349
349
describe ( 'preparePageInfo()' , ( ) => {
350
- const edges = [
350
+ const fiveEdges = [
351
351
{ cursor : 1 , node : 1 } ,
352
352
{ cursor : 2 , node : 2 } ,
353
353
{ cursor : 3 , node : 3 } ,
@@ -357,37 +357,37 @@ describe('connectionResolver', () => {
357
357
358
358
describe ( '"Relay Cursor Connections Specification (PageInfo)":' , ( ) => {
359
359
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 ) ;
362
362
} ) ;
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 ) ;
365
365
} ) ;
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 ) ;
368
368
} ) ;
369
369
} ) ;
370
370
371
371
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 ) ;
374
374
} ) ;
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 ) ;
377
377
} ) ;
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 ) ;
380
380
} ) ;
381
381
} ) ;
382
382
383
383
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 ) ;
386
386
} ) ;
387
387
388
388
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 ) ;
391
391
} ) ;
392
392
393
393
it ( 'should return correct values for pageInfo if last is less first' , async ( ) => {
0 commit comments