fix(graphics-factory): add test case verifying fix

Related to #1129
This commit is contained in:
Philipp Fromme 2019-07-17 13:16:26 +02:00 committed by Nico Rehwaldt
parent aba0088e5e
commit d0044f8313
2 changed files with 85 additions and 2 deletions

View File

@ -1,19 +1,23 @@
import { import {
bootstrapModeler, bootstrapModeler,
inject inject,
getBpmnJS
} from 'test/TestHelper'; } from 'test/TestHelper';
import { import {
pick pick
} from 'min-dash'; } from 'min-dash';
import modelingModule from 'lib/features/modeling'; import contextPadModule from 'lib/features/context-pad';
import coreModule from 'lib/core'; import coreModule from 'lib/core';
import modelingModule from 'lib/features/modeling';
import { import {
getChildLanes getChildLanes
} from 'lib/features/modeling/util/LaneUtil'; } from 'lib/features/modeling/util/LaneUtil';
import { query as domQuery } from 'min-dom';
var DEFAULT_LANE_HEIGHT = 120; var DEFAULT_LANE_HEIGHT = 120;
@ -262,4 +266,62 @@ describe('features/modeling - add Lane', function() {
}); });
describe('Internet Explorer', function() {
var diagramXML = require('./participant-single-lane.bpmn');
var testModules = [
contextPadModule,
coreModule,
modelingModule
];
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
// must be executed manually, cannot be reproduced programmatically
// https://github.com/bpmn-io/bpmn-js/issues/746
it('should NOT blow up in Internet Explorer', inject(
function(contextPad, elementRegistry) {
// given
var lane = elementRegistry.get('Lane_1');
contextPad.open(lane);
// mock event
var event = padEvent('lane-insert-below');
// when
contextPad.trigger('click', event);
// then
// expect Internet Explorer NOT to blow up
}
));
});
}); });
// helpers //////////
function padEntry(element, name) {
return domQuery('[data-action="' + name + '"]', element);
}
function padEvent(entry) {
return getBpmnJS().invoke(function(overlays) {
var target = padEntry(overlays._overlayRoot, entry);
return {
target: target,
preventDefault: function() {},
clientX: 100,
clientY: 100
};
});
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0e8iwaa" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.2">
<bpmn:collaboration id="Collaboration_1">
<bpmn:participant id="Participant_1" name="Participant_1" processRef="Process_1" />
</bpmn:collaboration>
<bpmn:process id="Process_1" isExecutable="true" camunda:modelerTemplate="test">
<bpmn:laneSet id="LaneSet_19hihz6">
<bpmn:lane id="Lane_1" name="Lane_1" />
</bpmn:laneSet>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1">
<bpmndi:BPMNShape id="Participant_1j1fs6n_di" bpmnElement="Participant_1" isHorizontal="true">
<dc:Bounds x="164" y="110" width="600" height="250" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_0fl7487_di" bpmnElement="Lane_1" isHorizontal="true">
<dc:Bounds x="194" y="110" width="570" height="250" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>