@@ -65,10 +65,6 @@ describe('license provision', () => {
6565 'demo' ,
6666 '--quantity' ,
6767 '5' ,
68- '--start-date' ,
69- '2026-03-30' ,
70- '--end-date' ,
71- '2027-03-30' ,
7268 ] ) ;
7369
7470 const tableCall = sfCommandStubs . table . firstCall . args [ 0 ] as { data : Array < Record < string , string > > ; title : string } ;
@@ -99,10 +95,6 @@ describe('license provision', () => {
9995 'demo' ,
10096 '--quantity' ,
10197 '5' ,
102- '--start-date' ,
103- '2026-03-30' ,
104- '--end-date' ,
105- '2027-03-30' ,
10698 ] ) ;
10799
108100 expect ( requestStub . calledOnce ) . to . be . true ;
@@ -116,21 +108,9 @@ describe('license provision', () => {
116108 namespacePrefix : 'demo' ,
117109 permissionSetLicense : 'newLicense' ,
118110 quantity : 5 ,
119- startDate : '2026-03-30' ,
120- endDate : '2027-03-30' ,
121111 } ) ;
122112 } ) ;
123113
124- it ( 'defaults start-date to today when not provided' , async ( ) => {
125- const today = new Date ( ) . toISOString ( ) . slice ( 0 , 10 ) ;
126-
127- await LicenseProvision . run ( [ '--target-org' , testOrg . username , '--license' , 'myLicense' ] ) ;
128-
129- const callArgs = requestStub . firstCall . args [ 0 ] as { body : string } ;
130- const body = JSON . parse ( callArgs . body ) as { licenses : Array < { startDate : string } > } ;
131- expect ( body . licenses [ 0 ] . startDate ) . to . equal ( today ) ;
132- } ) ;
133-
134114 it ( 'returns status:success result with traceId' , async ( ) => {
135115 const result = await LicenseProvision . run ( [ '--target-org' , testOrg . username , '--license' , 'myLicense' ] ) ;
136116 expect ( result ) . to . deep . equal ( { status : 'success' , traceId : 'tm_test123' } ) ;
@@ -268,16 +248,16 @@ describe('license provision', () => {
268248
269249 it ( 'wraps a HTTP 400 provisioning error as SfError' , async ( ) => {
270250 requestStub . rejects (
271- Object . assign ( new Error ( "Invalid endDate format for permissionSetLicense 'premium'" ) , {
272- name : 'INVALID_END_DATE ' ,
251+ Object . assign ( new Error ( "Invalid quantity for permissionSetLicense 'premium'" ) , {
252+ name : 'INVALID_QUANTITY ' ,
273253 } )
274254 ) ;
275255
276256 try {
277257 await LicenseProvision . run ( [ '--target-org' , testOrg . username , '--license' , 'premium' ] ) ;
278258 expect . fail ( 'Expected an error to be thrown' ) ;
279259 } catch ( error : unknown ) {
280- expect ( ( error as Error ) . message ) . to . include ( 'Invalid endDate format ' ) ;
260+ expect ( ( error as Error ) . message ) . to . include ( 'Invalid quantity ' ) ;
281261 }
282262 } ) ;
283263
0 commit comments