diff --git a/rules/camunda-cloud/element-type/config.js b/rules/camunda-cloud/element-type/config.js index 76400fb..440821a 100644 --- a/rules/camunda-cloud/element-type/config.js +++ b/rules/camunda-cloud/element-type/config.js @@ -63,5 +63,6 @@ module.exports = { 'bpmn:SubProcess': '1.0', 'bpmn:Task': '8.2', 'bpmn:TextAnnotation': '1.0', - 'bpmn:UserTask': '1.0' + 'bpmn:UserTask': '1.0', + 'bpmn:AdHocSubProcess': '8.7', }; \ No newline at end of file diff --git a/test/camunda-cloud/camunda-cloud-8-3-element-type.spec.js b/test/camunda-cloud/camunda-cloud-8-3-element-type.spec.js index 87c3cc1..5db7cf4 100644 --- a/test/camunda-cloud/camunda-cloud-8-3-element-type.spec.js +++ b/test/camunda-cloud/camunda-cloud-8-3-element-type.spec.js @@ -119,6 +119,8 @@ const valid = [ } ]; +module.exports.valid = valid; + const invalid = [ { name: 'boundary event (no event definition)', diff --git a/test/camunda-cloud/camunda-cloud-8-6-element-type.spec.js b/test/camunda-cloud/camunda-cloud-8-6-element-type.spec.js new file mode 100644 index 0000000..55ac353 --- /dev/null +++ b/test/camunda-cloud/camunda-cloud-8-6-element-type.spec.js @@ -0,0 +1,43 @@ +const RuleTester = require('bpmnlint/lib/testers/rule-tester'); + +const rule = require('../../rules/camunda-cloud/element-type'); + +const { + withConfig, + createModdle, + createProcess +} = require('../helper'); + +const { ERROR_TYPES } = require('../../rules/utils/element'); + +const valid = [ + ...require('./camunda-cloud-8-3-element-type.spec').valid +]; + +module.exports.valid = valid; + +const invalid = [ + { + name: 'ad-hoc subprocess', + moddleElement: createModdle(createProcess(` + + + `)), + report: { + id: 'Subprocess_1', + message: 'Element of type only allowed by Camunda 8.7 or newer', + path: null, + data: { + type: ERROR_TYPES.ELEMENT_TYPE_NOT_ALLOWED, + node: 'Subprocess_1', + parentNode: null, + allowedVersion: '8.7' + } + } + } +]; + +RuleTester.verify('camunda-cloud-8-6-element-type', rule, { + valid: withConfig(valid, { version: '8.6' }), + invalid: withConfig(invalid, { version: '8.6' }), +}); diff --git a/test/camunda-cloud/camunda-cloud-8-7-element-type.spec.js b/test/camunda-cloud/camunda-cloud-8-7-element-type.spec.js new file mode 100644 index 0000000..213bb22 --- /dev/null +++ b/test/camunda-cloud/camunda-cloud-8-7-element-type.spec.js @@ -0,0 +1,29 @@ +const RuleTester = require('bpmnlint/lib/testers/rule-tester'); + +const rule = require('../../rules/camunda-cloud/element-type'); + +const { + withConfig, + createModdle, + createProcess +} = require('../helper'); + +const valid = [ + ...require('./camunda-cloud-8-6-element-type.spec').valid, + { + name: 'ad-hoc subprocess', + moddleElement: createModdle(createProcess(` + + + + + + + `)) + } +]; + +RuleTester.verify('camunda-cloud-8-7-element-type', rule, { + valid: withConfig(valid, { version: '8.7' }), + invalid: [] +});