Skip to content

Commit

Permalink
feat(test.Routers): use useVertices option for test purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKanera committed Jun 26, 2023
1 parent bba9e38 commit 005ee34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/jointjs/routers.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ QUnit.module('routers', function(hooks) {
const height = 50;
const size = { width, height };
const margin = 28;
const router = { name: 'rightAngle', args: { margin }};
const rightAngleRouter = { name: 'rightAngle', args: { margin }};
const position = { x: 0, y: 150 };

this.addTestSubjects = function(sourceSide, targetSide) {
this.addTestSubjects = function(sourceSide, targetSide, router = rightAngleRouter) {
const r1 = new joint.shapes.standard.Rectangle({ size });
const r2 = r1.clone().position(position.x, position.y);
const l = new joint.shapes.standard.Link({ source: { id: r1.id, anchor: { name: sourceSide }}, target: { id: r2.id, anchor: { name: targetSide }}, router });
Expand All @@ -456,7 +456,7 @@ QUnit.module('routers', function(hooks) {
};

this.addTestSubjectsWithVertex = function(sourceSide, targetSide, vertex) {
const [r1, r2, l] = this.addTestSubjects(sourceSide, targetSide);
const [r1, r2, l] = this.addTestSubjects(sourceSide, targetSide, { ...rightAngleRouter, args: { margin, useVertices: true }});
l.vertices([vertex]);
return [r1, r2, l];
};
Expand Down

0 comments on commit 005ee34

Please sign in to comment.