diff --git a/client/src/app/util/__tests__/generateImageSpec.js b/client/src/app/util/__tests__/generateImageSpec.js index 8e7cebe8fe..a8c0953251 100644 --- a/client/src/app/util/__tests__/generateImageSpec.js +++ b/client/src/app/util/__tests__/generateImageSpec.js @@ -24,7 +24,8 @@ const expectedImagesByType = { describe('util - generateImage', function() { const svg = require('./diagram.svg'), - outOfBoundsSVG = require('./out_of_bounds_diagram.svg'); + outOfBoundsSVG = require('./out_of_bounds_diagram.svg'), + webhookSVG = require('./webhook.svg'); keys(expectedImagesByType).forEach(function(type) { @@ -32,7 +33,7 @@ describe('util - generateImage', function() { const image = await generateImage(type, svg); - expect(image).to.exist; + expectToBeAnImage(image); }); @@ -40,10 +41,7 @@ describe('util - generateImage', function() { const image = await generateImage(type, outOfBoundsSVG); - // if image cannot be generated properly it returns a data string with - // 6 characters. If it is generated, image.length returns the actual size - // of the generated image which is more than 6. - expect(image.length).to.be.greaterThan(6); + expectToBeAnImage(image); }).timeout(10000); // downscaling may exceed the default timeout 2000ms. @@ -54,6 +52,25 @@ describe('util - generateImage', function() { expect(image).to.be.eql(expectedImage); }); + + + it('should handle webhook icon <' + type + '>', async function() { + + const image = await generateImage(type, webhookSVG); + + expectToBeAnImage(image); + }); }); }); + + +/** + * If image cannot be generated properly it returns a data string with + * 6 characters. If it is generated, image.length returns the actual size + * of the generated image which is more than 6. + */ +function expectToBeAnImage(image) { + expect(image).to.exist; + expect(image.length).to.be.greaterThan(6); +} diff --git a/client/src/app/util/__tests__/webhook.svg b/client/src/app/util/__tests__/webhook.svg new file mode 100644 index 0000000000..aa9c95e991 --- /dev/null +++ b/client/src/app/util/__tests__/webhook.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4552104926..471f44abfb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2735,9 +2735,10 @@ } }, "node_modules/@bpmn-io/element-template-icon-renderer/node_modules/tiny-svg": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.0.1.tgz", - "integrity": "sha512-P8T4iwiW1t95vpHVHqrD36Brn7TqFYCPSHIWk9WLJtYK1X4aDd+5cgqcAADIWSjf1/i5idKnpCh9mim8hEdRBg==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==", + "license": "MIT" }, "node_modules/@bpmn-io/element-templates-validator": { "version": "2.1.0", @@ -11279,9 +11280,10 @@ } }, "node_modules/bpmn-js/node_modules/tiny-svg": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.2.tgz", - "integrity": "sha512-qvNlv/4N48HqbNpwAhzQ9HKHlBUKgA4091x+aVfsrRXHIcQ9NA3W6ZYwdmYAIdwT+vfAAksrc9L/3RQBj5KwPw==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==", + "license": "MIT" }, "node_modules/bpmn-moddle": { "version": "9.0.1", @@ -14590,9 +14592,10 @@ "integrity": "sha512-to+unsToePnm7cUeR9TrMzFlETHd/UXmU+ELTRfWZj5XGT41KF6X3L233o3E/GdEs3sk2Tbw/lOLD1avmWkg8A==" }, "node_modules/diagram-js-grid/node_modules/tiny-svg": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.0.1.tgz", - "integrity": "sha512-P8T4iwiW1t95vpHVHqrD36Brn7TqFYCPSHIWk9WLJtYK1X4aDd+5cgqcAADIWSjf1/i5idKnpCh9mim8hEdRBg==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==", + "license": "MIT" }, "node_modules/diagram-js-minimap": { "version": "5.1.0", @@ -14625,9 +14628,10 @@ } }, "node_modules/diagram-js-minimap/node_modules/tiny-svg": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.2.tgz", - "integrity": "sha512-qvNlv/4N48HqbNpwAhzQ9HKHlBUKgA4091x+aVfsrRXHIcQ9NA3W6ZYwdmYAIdwT+vfAAksrc9L/3RQBj5KwPw==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==", + "license": "MIT" }, "node_modules/diagram-js-origin": { "version": "1.4.0", @@ -14640,7 +14644,9 @@ } }, "node_modules/diagram-js-origin/node_modules/tiny-svg": { - "version": "3.0.0", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==", "license": "MIT" }, "node_modules/diagram-js/node_modules/component-event": { @@ -14675,9 +14681,9 @@ } }, "node_modules/diagram-js/node_modules/tiny-svg": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.2.tgz", - "integrity": "sha512-qvNlv/4N48HqbNpwAhzQ9HKHlBUKgA4091x+aVfsrRXHIcQ9NA3W6ZYwdmYAIdwT+vfAAksrc9L/3RQBj5KwPw==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==", "license": "MIT" }, "node_modules/didi": { @@ -14927,9 +14933,10 @@ } }, "node_modules/dmn-js-drd/node_modules/tiny-svg": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.2.tgz", - "integrity": "sha512-qvNlv/4N48HqbNpwAhzQ9HKHlBUKgA4091x+aVfsrRXHIcQ9NA3W6ZYwdmYAIdwT+vfAAksrc9L/3RQBj5KwPw==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==", + "license": "MIT" }, "node_modules/dmn-js-literal-expression": { "version": "16.7.1", @@ -35366,9 +35373,9 @@ }, "dependencies": { "tiny-svg": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.0.1.tgz", - "integrity": "sha512-P8T4iwiW1t95vpHVHqrD36Brn7TqFYCPSHIWk9WLJtYK1X4aDd+5cgqcAADIWSjf1/i5idKnpCh9mim8hEdRBg==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==" } } }, @@ -41613,9 +41620,9 @@ } }, "tiny-svg": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.2.tgz", - "integrity": "sha512-qvNlv/4N48HqbNpwAhzQ9HKHlBUKgA4091x+aVfsrRXHIcQ9NA3W6ZYwdmYAIdwT+vfAAksrc9L/3RQBj5KwPw==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==" } } }, @@ -44614,9 +44621,9 @@ "integrity": "sha512-6kJqKWryKZmtte6QYvouas0/EIJKPI1/MMIuRsiBlNuhIMfqYTggzX2F1AJ2+cDs288xyi9GL7FyasHINR98BQ==" }, "tiny-svg": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.2.tgz", - "integrity": "sha512-qvNlv/4N48HqbNpwAhzQ9HKHlBUKgA4091x+aVfsrRXHIcQ9NA3W6ZYwdmYAIdwT+vfAAksrc9L/3RQBj5KwPw==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==" } } }, @@ -44642,9 +44649,9 @@ "integrity": "sha512-to+unsToePnm7cUeR9TrMzFlETHd/UXmU+ELTRfWZj5XGT41KF6X3L233o3E/GdEs3sk2Tbw/lOLD1avmWkg8A==" }, "tiny-svg": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.0.1.tgz", - "integrity": "sha512-P8T4iwiW1t95vpHVHqrD36Brn7TqFYCPSHIWk9WLJtYK1X4aDd+5cgqcAADIWSjf1/i5idKnpCh9mim8hEdRBg==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==" } } }, @@ -44679,9 +44686,9 @@ } }, "tiny-svg": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.2.tgz", - "integrity": "sha512-qvNlv/4N48HqbNpwAhzQ9HKHlBUKgA4091x+aVfsrRXHIcQ9NA3W6ZYwdmYAIdwT+vfAAksrc9L/3RQBj5KwPw==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==" } } }, @@ -44692,7 +44699,9 @@ }, "dependencies": { "tiny-svg": { - "version": "3.0.0" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==" } } }, @@ -44908,9 +44917,9 @@ "integrity": "sha512-6kJqKWryKZmtte6QYvouas0/EIJKPI1/MMIuRsiBlNuhIMfqYTggzX2F1AJ2+cDs288xyi9GL7FyasHINR98BQ==" }, "tiny-svg": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.2.tgz", - "integrity": "sha512-qvNlv/4N48HqbNpwAhzQ9HKHlBUKgA4091x+aVfsrRXHIcQ9NA3W6ZYwdmYAIdwT+vfAAksrc9L/3RQBj5KwPw==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tiny-svg/-/tiny-svg-3.1.3.tgz", + "integrity": "sha512-9mwnPqXInRsBmH/DO6NMxBE++9LsqpVXQSSTZGc5bomoKKvL5OX/Hlotw7XVXP6XLRcHWIzZpxfovGqWKgCypQ==" } } },