@@ -108,19 +108,19 @@ describe('api-client', () => {
108108
109109 describe ( 'getOrgUsers' , ( ) => {
110110 it ( 'should paginate getInvitations for organization owners' , async ( ) => {
111- const page1 = Array . from ( { length : 10 } , ( _ , i ) => makeUser ( i ) ) ;
112- const page2 = Array . from ( { length : 10 } , ( _ , i ) => makeUser ( i + 10 ) ) ;
113- const page3 = Array . from ( { length : 5 } , ( _ , i ) => makeUser ( i + 20 ) ) ;
111+ const page1 = Array . from ( { length : config . limit } , ( _ , i ) => makeUser ( i ) ) ;
112+ const page2 = Array . from ( { length : config . limit } , ( _ , i ) => makeUser ( i + config . limit ) ) ;
113+ const page3 = Array . from ( { length : 25 } , ( _ , i ) => makeUser ( i + config . limit * 2 ) ) ;
114114
115115 const { client, getInvitations, invitationParams } = createPaginatedMockClient (
116116 { is_owner : true } ,
117- [ page1 , page2 , page3 , [ ] ] ,
117+ [ page1 , page2 , page3 ] ,
118118 ) ;
119119
120120 const result = await getOrgUsers ( client , ORG_UID ) ;
121121
122- expect ( result . items ) . to . have . lengthOf ( 25 ) ;
123- expect ( getInvitations . callCount ) . to . equal ( 4 ) ;
122+ expect ( result . items ) . to . have . lengthOf ( 225 ) ;
123+ expect ( getInvitations . callCount ) . to . equal ( 3 ) ;
124124 expect ( invitationParams [ 0 ] ) . to . deep . equal ( { skip : 0 , page : 1 , limit : config . limit } ) ;
125125 expect ( invitationParams [ 1 ] ) . to . deep . equal ( { skip : config . limit , page : 2 , limit : config . limit } ) ;
126126 expect ( invitationParams [ 2 ] ) . to . deep . equal ( {
@@ -131,19 +131,19 @@ describe('api-client', () => {
131131 } ) ;
132132
133133 it ( 'should paginate getInvitations for organization admins' , async ( ) => {
134- const page1 = Array . from ( { length : 10 } , ( _ , i ) => makeUser ( i ) ) ;
135- const page2 = Array . from ( { length : 10 } , ( _ , i ) => makeUser ( i + 10 ) ) ;
136- const page3 = Array . from ( { length : 5 } , ( _ , i ) => makeUser ( i + 20 ) ) ;
134+ const page1 = Array . from ( { length : config . limit } , ( _ , i ) => makeUser ( i ) ) ;
135+ const page2 = Array . from ( { length : config . limit } , ( _ , i ) => makeUser ( i + config . limit ) ) ;
136+ const page3 = Array . from ( { length : 25 } , ( _ , i ) => makeUser ( i + config . limit * 2 ) ) ;
137137
138138 const { client, getInvitations, invitationParams } = createPaginatedMockClient (
139139 { is_owner : false , org_roles : [ { admin : true } ] } ,
140- [ page1 , page2 , page3 , [ ] ] ,
140+ [ page1 , page2 , page3 ] ,
141141 ) ;
142142
143143 const result = await getOrgUsers ( client , ORG_UID ) ;
144144
145- expect ( result . items ) . to . have . lengthOf ( 25 ) ;
146- expect ( getInvitations . callCount ) . to . equal ( 4 ) ;
145+ expect ( result . items ) . to . have . lengthOf ( 225 ) ;
146+ expect ( getInvitations . callCount ) . to . equal ( 3 ) ;
147147 expect ( invitationParams [ 0 ] ) . to . deep . equal ( { skip : 0 , page : 1 , limit : config . limit } ) ;
148148 } ) ;
149149
0 commit comments