chore(tests): use have.waypoints helper

This commit is contained in:
Nico Rehwaldt 2017-12-13 11:28:14 +01:00 committed by Nico Rehwaldt
parent f24b21684d
commit 869e484601
2 changed files with 57 additions and 59 deletions

View File

@ -87,10 +87,8 @@ describe('features/modeling - layout association', function() {
// when
modeling.moveElements([ textAnnotationShape ], { x: 20, y: 0 }, rootShape);
waypoints = textAnnotationShape.outgoing[0].waypoints;
// then
expect(waypoints).to.eql([
expect(connection).to.have.waypoints([
{ original: { x: 420, y: 400 }, x: 417, y: 385 },
{ x: 400, y: 300 },
{ original: { x: 191, y: 120 }, x: 204, y: 131 }

View File

@ -61,10 +61,10 @@ describe('features/modeling - layout', function() {
var connection = connect('ExclusiveGateway_1', 'BusinessRuleTask_1');
// then
expect(connection.waypoints).to.eql([
{ original: { x:678,y:302 },x:678,y:277 },
{ x:678,y:220 },
{ original: { x:840,y:220 },x:790,y:220 }
expect(connection).to.have.waypoints([
{ original: { x: 678, y: 302 }, x: 678, y: 277 },
{ x: 678, y: 220 },
{ original: { x: 840, y: 220 }, x: 790, y: 220 }
]);
}));
@ -75,10 +75,10 @@ describe('features/modeling - layout', function() {
var connection = connect('BusinessRuleTask_1', 'ParallelGateway_1');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:840,y:220 },x:890,y:220 },
{ x:1005,y:220 },
{ original:{ x:1005,y:302 },x:1005,y:277 }
expect(connection).to.have.waypoints([
{ original: { x: 840, y: 220 }, x: 890, y: 220 },
{ x: 1005, y: 220 },
{ original: { x: 1005, y: 302 }, x: 1005, y: 277 }
]);
}));
@ -93,11 +93,11 @@ describe('features/modeling - layout', function() {
var connection = connect('StartEvent_1', 'Task_1');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:170,y:302 },x:188,y:302 },
{ x:235,y:302 },
{ x:235,y:220 },
{ original:{ x:332,y:220 },x:282,y:220 }
expect(connection).to.have.waypoints([
{ original: { x: 170, y: 302 }, x: 188, y: 302 },
{ x: 235, y: 302 },
{ x: 235, y: 220 },
{ original: { x: 332, y: 220 }, x: 282, y: 220 }
]);
}));
@ -108,11 +108,11 @@ describe('features/modeling - layout', function() {
var connection = connect('ServiceTask_1', 'BusinessRuleTask_1');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:678,y:117 },x:728,y:117 },
{ x:759,y:117 },
{ x:759,y:220 },
{ original:{ x:840,y:220 },x:790,y:220 }
expect(connection).to.have.waypoints([
{ original: { x: 678, y: 117 }, x: 728, y: 117 },
{ x: 759, y: 117 },
{ x: 759, y: 220 },
{ original: { x: 840, y: 220 }, x: 790, y: 220 }
]);
}));
@ -123,11 +123,11 @@ describe('features/modeling - layout', function() {
var connection = connect('IntermediateThrowEvent_1', 'ServiceTask_1');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:496,y:302 },x:514,y:302 },
{ x:571,y:302 },
{ x:571,y:117 },
{ original:{ x:678,y:117 },x:628,y:117 }
expect(connection).to.have.waypoints([
{ original: { x: 496, y: 302 }, x: 514, y: 302 },
{ x: 571, y: 302 },
{ x: 571, y: 117 },
{ original: { x: 678, y: 117 }, x: 628, y: 117 }
]);
}));
@ -138,11 +138,11 @@ describe('features/modeling - layout', function() {
var connection = connect('IntermediateThrowEvent_1', 'Task_1');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:496,y:302 },x:478,y:302 },
{ x:430,y:302 },
{ x:430,y:220 },
{ original:{ x:332,y:220 },x:382,y:220 }
expect(connection).to.have.waypoints([
{ original: { x: 496, y: 302 }, x: 478, y: 302 },
{ x: 430, y: 302 },
{ x: 430, y: 220 },
{ original: { x: 332, y: 220 }, x: 382, y: 220 }
]);
}));
@ -227,11 +227,11 @@ describe('features/modeling - layout', function() {
var connection = connect('BoundaryEvent_A', 'Task_1');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:505,y:417 },x:487,y:417 },
{ x:437,y:417 },
{ x:437,y:394 },
{ original:{ x:337,y:394 },x:387,y:394 }
expect(connection).to.have.waypoints([
{ original: { x: 505, y: 417 }, x: 487, y: 417 },
{ x: 437, y: 417 },
{ x: 437, y: 394 },
{ original: { x: 337, y: 394 }, x: 387, y: 394 }
]);
}));
@ -242,10 +242,10 @@ describe('features/modeling - layout', function() {
var connection = connect('BoundaryEvent_A', 'Task_2');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:505,y:417 },x:487,y:417 },
{ x:412,y:417 },
{ original:{ x:412,y:543 },x:412,y:503 }
expect(connection).to.have.waypoints([
{ original: { x: 505, y: 417 }, x: 487, y: 417 },
{ x: 412, y: 417 },
{ original: { x: 412, y: 543 }, x: 412, y: 503 }
]);
}));
@ -256,10 +256,10 @@ describe('features/modeling - layout', function() {
var connection = connect('BoundaryEvent_A', 'Task_5');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:505,y:417 },x:523,y:417 },
{ x:1016,y:417 },
{ original:{ x:1016,y:215 },x:1016,y:255 }
expect(connection).to.have.waypoints([
{ original: { x: 505, y: 417 }, x: 523, y: 417 },
{ x: 1016, y: 417 },
{ original: { x: 1016, y: 215 }, x: 1016, y: 255 }
]);
}));
@ -270,9 +270,9 @@ describe('features/modeling - layout', function() {
var connection = connect('BoundaryEvent_B', 'Task_4');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:586,y:258 },x:586,y:240 },
{ original:{ x:586,y:121 },x:586,y:161 }
expect(connection).to.have.waypoints([
{ original: { x: 586, y: 258 }, x: 586, y: 240 },
{ original: { x: 586, y: 121 }, x: 586, y: 161 }
]);
}));
@ -283,10 +283,10 @@ describe('features/modeling - layout', function() {
var connection = connect('BoundaryEvent_B', 'Task_3');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:586,y:258 },x:586,y:258 },
{ x:586,y:162 },
{ original:{ x:428,y:162 },x:478,y:162 }
expect(connection).to.have.waypoints([
{ original: { x: 586, y: 258 }, x: 586, y: 258 },
{ x: 586, y: 162 },
{ original: { x: 428, y: 162 }, x: 478, y: 162 }
]);
}));
@ -297,10 +297,10 @@ describe('features/modeling - layout', function() {
var connection = connect('BoundaryEvent_C', 'Task_6');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:855,y:293 },x:873,y:293 },
{ x:1041,y:293 },
{ original:{ x:1041,y:483 },x:1041,y:443 }
expect(connection).to.have.waypoints([
{ original: { x: 855, y: 293 }, x: 873, y: 293 },
{ x: 1041, y: 293 },
{ original: { x: 1041, y: 483 }, x: 1041, y: 443 }
]);
}));
@ -311,10 +311,10 @@ describe('features/modeling - layout', function() {
var connection = connect('BoundaryEvent_D', 'Task_2');
// then
expect(connection.waypoints).to.eql([
{ original:{ x:815,y:458 },x:815,y:476 },
{ x:815,y:543 },
{ original:{ x:412,y:543 },x:462,y:543 }
expect(connection).to.have.waypoints([
{ original: { x: 815, y: 458 }, x: 815, y: 476 },
{ x: 815, y: 543 },
{ original: { x: 412, y: 543 }, x: 462, y: 543 }
]);
}));