Skip to content

Commit

Permalink
test: add user task forms integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Apr 20, 2022
1 parent 01129c1 commit 5610267
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion test/spec/provider/camunda-platform/FormTypeProps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import CoreModule from 'bpmn-js/lib/core';
import SelectionModule from 'diagram-js/lib/features/selection';
import ModelingModule from 'bpmn-js/lib/features/modeling';

import BehaviorsModule from 'camunda-bpmn-js-behaviors/lib/camunda-platform';

import BpmnPropertiesPanel from 'src/render';

import BpmnPropertiesProvider from 'src/provider/bpmn';
Expand All @@ -42,7 +44,8 @@ describe('provider/camunda-platform - FormTypeProps', function() {
CamundaPlatformPropertiesProvider,
CoreModule,
ModelingModule,
SelectionModule
SelectionModule,
BehaviorsModule
];

const moddleExtensions = {
Expand Down Expand Up @@ -291,6 +294,54 @@ describe('provider/camunda-platform - FormTypeProps', function() {
expect(select.value).to.equal('');
}));


describe('integration', function() {

it('should remove form key when form ref is set', inject(async function(elementRegistry, selection) {

// given
const task = elementRegistry.get('StartEvent_FormKey'),
businessObject = getBusinessObject(task);

await act(() => {
selection.select(task);
});

// when
const select = domQuery('select[name=formType]', container);

changeInput(select, 'formRef');

// then
expect(businessObject.get('camunda:formKey')).not.to.exist;
expect(businessObject.get('camunda:formRef')).to.equal('');
}));


it('should remove form ref when form key is set', inject(async function(elementRegistry, selection) {

// given
const task = elementRegistry.get('StartEvent_FormRef'),
businessObject = getBusinessObject(task);

await act(() => {
selection.select(task);
});

// when
const select = domQuery('select[name=formType]', container);

changeInput(select, 'formKey');

// then
expect(businessObject.get('camunda:formRef')).not.to.exist;
expect(businessObject.get('camunda:formRefBinding')).not.to.exist;
expect(businessObject.get('camunda:formRefVersion')).not.to.exist;
expect(businessObject.get('camunda:formKey')).to.equal('');
}));

});

});

// helpers //////////
Expand Down

0 comments on commit 5610267

Please sign in to comment.