File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,28 +251,38 @@ describe('versionCommands.update package range selection', () => {
251251 } ) ;
252252
253253 test ( 'applies minPackageVersion and maxPackageVersion together' , async ( ) => {
254- postSpy . mockClear ( ) ;
254+ const appId = 'range-app' ;
255255
256256 await versionCommands . update ( {
257257 options : {
258- appId : '100' ,
258+ appId,
259259 versionId : '200' ,
260260 minPackageVersion : '1.1.0' ,
261261 maxPackageVersion : '1.2.0' ,
262262 } ,
263263 } ) ;
264264
265- expect ( postSpy ) . toHaveBeenCalledTimes ( 2 ) ;
266- expect ( postSpy ) . toHaveBeenNthCalledWith ( 1 , '/app/100/binding' , {
267- versionId : '200' ,
268- rollout : undefined ,
269- packageId : '11' ,
270- } ) ;
271- expect ( postSpy ) . toHaveBeenNthCalledWith ( 2 , '/app/100/binding' , {
272- versionId : '200' ,
273- rollout : undefined ,
274- packageId : '12' ,
275- } ) ;
265+ const bindingCalls = postSpy . mock . calls . filter (
266+ ( [ url ] ) => url === `/app/${ appId } /binding` ,
267+ ) ;
268+
269+ expect ( bindingCalls ) . toHaveLength ( 2 ) ;
270+ expect ( bindingCalls [ 0 ] ) . toEqual ( [
271+ `/app/${ appId } /binding` ,
272+ {
273+ versionId : '200' ,
274+ rollout : undefined ,
275+ packageId : '11' ,
276+ } ,
277+ ] ) ;
278+ expect ( bindingCalls [ 1 ] ) . toEqual ( [
279+ `/app/${ appId } /binding` ,
280+ {
281+ versionId : '200' ,
282+ rollout : undefined ,
283+ packageId : '12' ,
284+ } ,
285+ ] ) ;
276286 } ) ;
277287
278288 test ( 'fails instead of prompting for package id in non-interactive mode' , async ( ) => {
You can’t perform that action at this time.
0 commit comments