2018-04-02 19:01:53 +00:00
|
|
|
import {
|
|
|
|
bootstrapModeler,
|
|
|
|
inject
|
|
|
|
} from 'test/TestHelper';
|
2016-01-27 08:45:05 +00:00
|
|
|
|
2018-04-02 19:01:53 +00:00
|
|
|
import modelingModule from 'lib/features/modeling';
|
2016-01-27 08:45:05 +00:00
|
|
|
|
|
|
|
|
2016-06-07 06:46:45 +00:00
|
|
|
describe('modeling/behavior - CompensationAssociation', function() {
|
2016-01-27 08:45:05 +00:00
|
|
|
|
|
|
|
var diagramXML = require('./CompensationAssociationBehavior.bpmn');
|
|
|
|
|
|
|
|
beforeEach(bootstrapModeler(diagramXML, { modules: modelingModule }));
|
|
|
|
|
|
|
|
|
|
|
|
it('should manhattan layout', inject(function(modeling, elementRegistry) {
|
|
|
|
|
|
|
|
// given
|
|
|
|
var boundaryShape = elementRegistry.get('CompensationBoundary'),
|
|
|
|
activityShape = elementRegistry.get('CompensationActivity');
|
|
|
|
|
|
|
|
|
|
|
|
// when
|
|
|
|
var newConnection = modeling.connect(boundaryShape, activityShape, {
|
|
|
|
type: 'bpmn:DataInputAssociation'
|
|
|
|
});
|
|
|
|
|
|
|
|
// then
|
|
|
|
expect(waypoints(newConnection)).to.eql([
|
|
|
|
{ x: 107, y: 142 },
|
|
|
|
{ x: 107, y: 254 },
|
|
|
|
{ x: 206, y: 254 }
|
|
|
|
]);
|
|
|
|
}));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function waypoints(connection) {
|
|
|
|
return connection.waypoints.map(function(wp) {
|
|
|
|
return { x: wp.x, y: wp.y };
|
|
|
|
});
|
|
|
|
}
|