@@ -16,12 +16,15 @@ const helper = require("./spechelper");
1616const { utils, api, uploader } = cloudinary . v2 ;
1717const TEST_TAG = helper . TEST_TAG ;
1818const IMAGE_URL = helper . IMAGE_URL ;
19+ const VIDEO_URL = helper . VIDEO_URL ;
1920const sharedExamples = helper . sharedExamples ;
2021const includeContext = helper . includeContext ;
2122const ARCHIVE_TAG = TEST_TAG + "_archive" ;
2223const PUBLIC_ID1 = ARCHIVE_TAG + "_1" ;
2324const PUBLIC_ID2 = ARCHIVE_TAG + "_2" ;
2425const PUBLIC_ID_RAW = ARCHIVE_TAG + "_3" ;
26+ const FULLY_QUALIFIED_IMAGE = "image/upload/sample" ;
27+ const FULLY_QUALIFIED_VIDEO = "video/upload/dog" ;
2528
2629sharedExamples ( 'archive' , function ( ) {
2730 before ( "Verify Configuration" , function ( ) {
@@ -56,6 +59,12 @@ sharedExamples('archive', function () {
5659 resource_type : "raw" ,
5760 tags : helper . UPLOAD_TAGS . concat ( [ ARCHIVE_TAG ] ) ,
5861 } ) ,
62+ uploader . upload ( VIDEO_URL ,
63+ {
64+ public_id : "dog" ,
65+ resource_type : "video" ,
66+ tags : helper . UPLOAD_TAGS . concat ( [ ARCHIVE_TAG ] ) ,
67+ } ) ,
5968 ] ) ;
6069 } ) ;
6170 after ( function ( ) {
@@ -152,6 +161,14 @@ describe("archive", function () {
152161 sinon . assert . calledWith ( write , sinon . match ( helper . uploadParamMatcher ( "target_format" , "zip" ) ) ) ;
153162 } ) ;
154163 } ) ;
164+ it ( 'should create archive with "zip" format and include multiple resource types' , function ( ) {
165+ return uploader . create_zip ( {
166+ fully_qualified_public_ids : [ FULLY_QUALIFIED_IMAGE , FULLY_QUALIFIED_VIDEO ] ,
167+ resource_type : "auto" ,
168+ } ) . then ( ( result ) => {
169+ expect ( result . file_count ) . to . eql ( 2 ) ;
170+ } ) ;
171+ } ) ;
155172 } ) ;
156173 } ) ;
157174} ) ;
0 commit comments