@@ -115,6 +115,9 @@ describe("Custom metadata field API", function () {
115115 it ( 'Get field' , function ( done ) {
116116 const scope = nock ( 'https://api.imagekit.io' )
117117 . get ( "/v1/customMetadataFields" )
118+ . query ( {
119+ includeDeleted : false
120+ } )
118121 . basicAuth ( { user : initializationParams . privateKey , pass : '' } )
119122 . reply ( function ( uri , requestBody ) {
120123 expect ( requestBody ) . to . be . empty ;
@@ -125,6 +128,24 @@ describe("Custom metadata field API", function () {
125128 imagekit . getCustomMetadataFields ( ) ;
126129 } ) ;
127130
131+ it ( 'Get field - includeDeleted true' , function ( done ) {
132+ const scope = nock ( 'https://api.imagekit.io' )
133+ . get ( "/v1/customMetadataFields" )
134+ . query ( {
135+ includeDeleted : true
136+ } )
137+ . basicAuth ( { user : initializationParams . privateKey , pass : '' } )
138+ . reply ( function ( uri , requestBody ) {
139+ expect ( requestBody ) . to . be . empty ;
140+ done ( ) ;
141+ return [ 200 ] ;
142+ } )
143+
144+ imagekit . getCustomMetadataFields ( {
145+ includeDeleted : true
146+ } ) ;
147+ } ) ;
148+
128149 it ( 'Update field' , function ( done ) {
129150 const scope = nock ( 'https://api.imagekit.io' )
130151 . patch ( "/v1/customMetadataFields/fieldId" )
@@ -235,11 +256,14 @@ describe("Custom metadata field API", function () {
235256 it ( 'Get fields' , function ( done ) {
236257 const scope = nock ( 'https://api.imagekit.io' )
237258 . get ( "/v1/customMetadataFields" )
259+ . query ( {
260+ includeDeleted : false
261+ } )
238262 . basicAuth ( { user : initializationParams . privateKey , pass : '' } )
239263 . reply ( 200 , [ dummyAPISuccessResponse , dummyAPISuccessResponse ] )
240264
241265 var callback = sinon . spy ( ) ;
242- imagekit . getCustomMetadataFields ( callback ) ;
266+ imagekit . getCustomMetadataFields ( { } , callback ) ;
243267
244268 setTimeout ( function ( ) {
245269 expect ( callback . calledOnce ) . to . be . true ;
@@ -312,11 +336,14 @@ describe("Custom metadata field API", function () {
312336 it ( 'Get fields' , function ( done ) {
313337 const scope = nock ( 'https://api.imagekit.io' )
314338 . get ( "/v1/customMetadataFields" )
339+ . query ( {
340+ includeDeleted : false
341+ } )
315342 . basicAuth ( { user : initializationParams . privateKey , pass : '' } )
316343 . reply ( 500 , dummyAPIErrorResponse )
317344
318345 var callback = sinon . spy ( ) ;
319- imagekit . getCustomMetadataFields ( callback ) ;
346+ imagekit . getCustomMetadataFields ( { } , callback ) ;
320347
321348 setTimeout ( function ( ) {
322349 expect ( callback . calledOnce ) . to . be . true ;
0 commit comments