Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/integration/api/uploader/uploader_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
2 changes: 1 addition & 1 deletion test/testUtils/testConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down