@@ -83,7 +83,9 @@ describe('paginated', () => {
8383
8484 it ( 'pages through id_ascending with no overlap and no gap' , ( ) => {
8585 // Items a..j; token is the first item of the next page (inclusive marker)
86- const items = Array . from ( { length : 10 } , ( _ , i ) => ( { id : String . fromCharCode ( 97 + i ) } ) )
86+ const items = Array . from ( { length : 10 } , ( _ , i ) => ( {
87+ id : String . fromCharCode ( 97 + i ) ,
88+ } ) )
8789 const p1 = paginated ( { limit : 3 } , items )
8890 expect ( p1 . items . map ( ( i ) => i . id ) ) . toEqual ( [ 'a' , 'b' , 'c' ] )
8991 expect ( p1 . next_page ) . toBe ( 'c' )
@@ -124,7 +126,10 @@ describe('paginated', () => {
124126 // next_page token format is "name|id" — last item on page, not first of next
125127 expect ( p1 . next_page ) . toBe ( 'yak|c' )
126128
127- const p2 = paginated ( { sortBy : 'name_descending' , limit : 2 , pageToken : p1 . next_page } , items )
129+ const p2 = paginated (
130+ { sortBy : 'name_descending' , limit : 2 , pageToken : p1 . next_page } ,
131+ items
132+ )
128133 expect ( p2 . items . map ( ( i ) => i . name ) ) . toEqual ( [ 'xerox' , 'walrus' ] )
129134 expect ( p2 . next_page ) . toBeNull ( )
130135 } )
@@ -154,7 +159,10 @@ describe('paginated', () => {
154159 // next_page token format is "timestamp|id" — last item on page, not first of next
155160 expect ( p1 . next_page ) . toBe ( `${ t1 } |c` )
156161
157- const p2 = paginated ( { sortBy : 'time_and_id_ascending' , limit : 2 , pageToken : p1 . next_page } , items )
162+ const p2 = paginated (
163+ { sortBy : 'time_and_id_ascending' , limit : 2 , pageToken : p1 . next_page } ,
164+ items
165+ )
158166 expect ( p2 . items . map ( ( i ) => i . id ) ) . toEqual ( [ 'b' ] )
159167 expect ( p2 . next_page ) . toBeNull ( )
160168 } )
@@ -172,7 +180,10 @@ describe('paginated', () => {
172180 expect ( p1 . items . map ( ( i ) => i . id ) ) . toEqual ( [ 'b' , 'a' ] )
173181 expect ( p1 . next_page ) . toBe ( `${ t1 } |a` )
174182
175- const p2 = paginated ( { sortBy : 'time_and_id_descending' , limit : 2 , pageToken : p1 . next_page } , items )
183+ const p2 = paginated (
184+ { sortBy : 'time_and_id_descending' , limit : 2 , pageToken : p1 . next_page } ,
185+ items
186+ )
176187 expect ( p2 . items . map ( ( i ) => i . id ) ) . toEqual ( [ 'c' ] )
177188 expect ( p2 . next_page ) . toBeNull ( )
178189 } )
0 commit comments