@@ -27,6 +27,7 @@ describe(commands.FILE_VERSION_LIST, () => {
2727 {
2828 "CheckInComment" : "" ,
2929 "Created" : "2022-10-30T12:03:06Z" ,
30+ "ExpirationDate" : "2026-01-31T08:23:43.0000000Z" ,
3031 "ID" : 512 ,
3132 "IsCurrentVersion" : false ,
3233 "Length" : "18898" ,
@@ -37,6 +38,7 @@ describe(commands.FILE_VERSION_LIST, () => {
3738 {
3839 "CheckInComment" : "" ,
3940 "Created" : "2022-10-30T12:06:13Z" ,
41+ "ExpirationDate" : null ,
4042 "ID" : 1024 ,
4143 "IsCurrentVersion" : false ,
4244 "Length" : "21098" ,
@@ -46,6 +48,7 @@ describe(commands.FILE_VERSION_LIST, () => {
4648 }
4749 ]
4850 } ;
51+ const queryString = "$select=*,ExpirationDate" ;
4952
5053 before ( ( ) => {
5154 sinon . stub ( auth , 'restoreAuth' ) . resolves ( ) ;
@@ -92,7 +95,7 @@ describe(commands.FILE_VERSION_LIST, () => {
9295 } ) ;
9396
9497 it ( 'defines correct properties for the default output' , ( ) => {
95- assert . deepStrictEqual ( command . defaultProperties ( ) , [ 'Created' , 'ID' , 'IsCurrentVersion' , 'VersionLabel' ] ) ;
98+ assert . deepStrictEqual ( command . defaultProperties ( ) , [ 'Created' , 'ID' , 'IsCurrentVersion' , 'VersionLabel' , 'ExpirationDate' ] ) ;
9699 } ) ;
97100
98101 it ( 'fails validation if fileId is not a valid guid' , async ( ) => {
@@ -122,7 +125,7 @@ describe(commands.FILE_VERSION_LIST, () => {
122125
123126 it ( 'retrieves versions from a file with the fileUrl option' , async ( ) => {
124127 sinon . stub ( request , 'get' ) . callsFake ( async ( opts ) => {
125- if ( opts . url === `${ validWebUrl } /_api/web/GetFileByServerRelativePath(DecodedUrl='${ formatting . encodeQueryParameter ( validFileUrl ) } ')/versions` ) {
128+ if ( opts . url === `${ validWebUrl } /_api/web/GetFileByServerRelativePath(DecodedUrl='${ formatting . encodeQueryParameter ( validFileUrl ) } ')/versions? ${ queryString } ` ) {
126129 return fileVersionResponse ;
127130 }
128131 throw 'Invalid request' ;
@@ -140,7 +143,7 @@ describe(commands.FILE_VERSION_LIST, () => {
140143
141144 it ( 'retrieves versions from a file with the fileId option' , async ( ) => {
142145 sinon . stub ( request , 'get' ) . callsFake ( async ( opts ) => {
143- if ( opts . url === `${ validWebUrl } /_api/web/GetFileById('${ validFileId } ')/versions` ) {
146+ if ( opts . url === `${ validWebUrl } /_api/web/GetFileById('${ validFileId } ')/versions? ${ queryString } ` ) {
144147 return fileVersionResponse ;
145148 }
146149 throw 'Invalid request' ;
@@ -159,7 +162,7 @@ describe(commands.FILE_VERSION_LIST, () => {
159162 it ( 'handles a random API error correctly' , async ( ) => {
160163 const err = 'Invalid versions request' ;
161164 sinon . stub ( request , 'get' ) . callsFake ( ( opts ) => {
162- if ( opts . url === `${ validWebUrl } /_api/web/GetFileById('${ validFileId } ')/versions` ) {
165+ if ( opts . url === `${ validWebUrl } /_api/web/GetFileById('${ validFileId } ')/versions? ${ queryString } ` ) {
163166 throw { error : { 'odata.error' : { message : { value : err } } } } ;
164167 }
165168
0 commit comments