@@ -250,23 +250,22 @@ describe('versionCommands.update package range selection', () => {
250250 postSpy . mockRestore ( ) ;
251251 } ) ;
252252
253- test ( 'applies minPackageVersion and maxPackageVersion together ' , async ( ) => {
254- const appId = 'range -app' ;
253+ test ( 'applies minPackageVersion as a lower bound ' , async ( ) => {
254+ const appId = 'min -app' ;
255255
256256 await versionCommands . update ( {
257257 options : {
258258 appId,
259259 versionId : '200' ,
260260 minPackageVersion : '1.1.0' ,
261- maxPackageVersion : '1.2.0' ,
262261 } ,
263262 } ) ;
264263
265264 const bindingCalls = postSpy . mock . calls . filter (
266265 ( [ url ] ) => url === `/app/${ appId } /binding` ,
267266 ) ;
268267
269- expect ( bindingCalls ) . toHaveLength ( 2 ) ;
268+ expect ( bindingCalls ) . toHaveLength ( 3 ) ;
270269 expect ( bindingCalls [ 0 ] ) . toEqual ( [
271270 `/app/${ appId } /binding` ,
272271 {
@@ -283,6 +282,56 @@ describe('versionCommands.update package range selection', () => {
283282 packageId : '12' ,
284283 } ,
285284 ] ) ;
285+ expect ( bindingCalls [ 2 ] ) . toEqual ( [
286+ `/app/${ appId } /binding` ,
287+ {
288+ versionId : '200' ,
289+ rollout : undefined ,
290+ packageId : '13' ,
291+ } ,
292+ ] ) ;
293+ } ) ;
294+
295+ test ( 'applies maxPackageVersion as an upper bound' , async ( ) => {
296+ const appId = 'max-app' ;
297+
298+ await versionCommands . update ( {
299+ options : {
300+ appId,
301+ versionId : '200' ,
302+ maxPackageVersion : '1.2.0' ,
303+ } ,
304+ } ) ;
305+
306+ const bindingCalls = postSpy . mock . calls . filter (
307+ ( [ url ] ) => url === `/app/${ appId } /binding` ,
308+ ) ;
309+
310+ expect ( bindingCalls ) . toHaveLength ( 3 ) ;
311+ expect ( bindingCalls [ 0 ] ) . toEqual ( [
312+ `/app/${ appId } /binding` ,
313+ {
314+ versionId : '200' ,
315+ rollout : undefined ,
316+ packageId : '10' ,
317+ } ,
318+ ] ) ;
319+ expect ( bindingCalls [ 1 ] ) . toEqual ( [
320+ `/app/${ appId } /binding` ,
321+ {
322+ versionId : '200' ,
323+ rollout : undefined ,
324+ packageId : '11' ,
325+ } ,
326+ ] ) ;
327+ expect ( bindingCalls [ 2 ] ) . toEqual ( [
328+ `/app/${ appId } /binding` ,
329+ {
330+ versionId : '200' ,
331+ rollout : undefined ,
332+ packageId : '12' ,
333+ } ,
334+ ] ) ;
286335 } ) ;
287336
288337 test ( 'fails instead of prompting for package id in non-interactive mode' , async ( ) => {
0 commit comments