mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-17 03:16:32 +00:00
test(snapping): simplify test case
This commit is contained in:
parent
27fec8bdf1
commit
b2179bd489
@ -559,38 +559,43 @@ describe('features/snapping - BpmnCreateMoveSnapping', function() {
|
|||||||
|
|
||||||
var diagramXML = require('./BpmnCreateMoveSnapping.docking-create-mode.bpmn');
|
var diagramXML = require('./BpmnCreateMoveSnapping.docking-create-mode.bpmn');
|
||||||
|
|
||||||
|
|
||||||
|
beforeEach(bootstrapModeler(diagramXML, {
|
||||||
|
modules: testModules
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
it('should correctly set snap origins', function(done) {
|
it('should correctly set snap origins', function(done) {
|
||||||
|
|
||||||
bootstrapModeler(diagramXML, {
|
var test = inject(function(elementRegistry, copyPaste, eventBus) {
|
||||||
container: TestContainer.get(this),
|
|
||||||
modules: testModules
|
|
||||||
})(function() {
|
|
||||||
inject(function(elementRegistry, copyPaste, eventBus) {
|
|
||||||
|
|
||||||
// given
|
// given
|
||||||
var task1 = elementRegistry.get('Task_1');
|
var task1 = elementRegistry.get('Task_1');
|
||||||
eventBus.on('create.start', function(event) {
|
eventBus.on('create.start', function(event) {
|
||||||
|
|
||||||
var snapContext = event.context.snapContext;
|
var snapContext = event.context.snapContext;
|
||||||
var snapLocations = snapContext.getSnapLocations();
|
var snapLocations = snapContext.getSnapLocations();
|
||||||
var sequenceFlowSnapOrigin = snapContext.getSnapOrigin(snapLocations[3]);
|
var sequenceFlowSnapOrigin = snapContext.getSnapOrigin(snapLocations[3]);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
|
try {
|
||||||
expect(sequenceFlowSnapOrigin.x).to.be.eql(-30);
|
expect(sequenceFlowSnapOrigin.x).to.be.eql(-30);
|
||||||
expect(sequenceFlowSnapOrigin.y).to.be.eql(-10);
|
expect(sequenceFlowSnapOrigin.y).to.be.eql(-10);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
} catch (error) {
|
||||||
|
done(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// when
|
// when
|
||||||
copyPaste.copy(task1);
|
copyPaste.copy(task1);
|
||||||
copyPaste.paste();
|
copyPaste.paste();
|
||||||
|
|
||||||
})();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user