From 9facf0f1913811a10416e526587706e91d234436 Mon Sep 17 00:00:00 2001 From: RTLcoil Date: Thu, 14 Jan 2021 21:13:44 +0200 Subject: [PATCH] Change test for `eval` upload parameter --- test/integration/api/uploader/uploader_spec.js | 5 ++--- test/testUtils/testConstants.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/integration/api/uploader/uploader_spec.js b/test/integration/api/uploader/uploader_spec.js index 880008e0..5b4f5f71 100644 --- a/test/integration/api/uploader/uploader_spec.js +++ b/test/integration/api/uploader/uploader_spec.js @@ -1136,18 +1136,17 @@ describe("uploader", function () { }); it('should add the eval parameter to an uploaded asset', async () => { - const testEvalTagsResult = ['a', 'b']; const result = await UPLOADER_V2.upload(IMAGE_FILE, { tags: [TEST_TAG], eval: TEST_EVAL_STR }); expect(result).not.to.be.empty(); - expect(result.tags).to.be.an("array"); - expect(result.tags).to.eql(testEvalTagsResult); expect(result.context).to.be.an("object"); expect(result.context.custom).to.be.an("object"); expect(result.context.custom.width).to.eql(TEST_IMG_WIDTH); + expect(result.quality_analysis).to.be.an("object"); + expect(result.quality_analysis.focus).to.be.an("number"); }); describe("sign requests", function () { diff --git a/test/testUtils/testConstants.js b/test/testUtils/testConstants.js index ddd05cde..1670a1a5 100644 --- a/test/testUtils/testConstants.js +++ b/test/testUtils/testConstants.js @@ -16,7 +16,7 @@ const UNIQUE_TEST_FOLDER = `${TEST_TAG}_${UNIQUE_JOB_SUFFIX_ID}_folder`; const TEST_IMG_WIDTH = 241; const TEST_CLOUD_NAME = process.env.CLOUDINARY_URL.split('@')[1]; -const TEST_EVAL_STR = 'if (resource_info["width"] < 450) { upload_options["tags"] = "a,b" }; ' + +const TEST_EVAL_STR = 'if (resource_info["width"] < 450) { upload_options["quality_analysis"] = true }; ' + 'upload_options["context"] = "width=" + resource_info["width"]'; module.exports = { TEST_TAG_PREFIX,