Skip to content

Commit

Permalink
chore: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Oct 11, 2024
1 parent 09a2358 commit 4a94f42
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 254 deletions.
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions test/spec/features/context-pad/ContextPadSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ describe('features/context-pad', function() {
}
}

var test = inject(function(canvas, contextPad) {
inject(function(canvas, contextPad) {

// given
var shape = { id: 's1', type: 'bigImage', width: 100, height: 100, x: 10, y: 10 };
Expand Down Expand Up @@ -1474,9 +1474,7 @@ describe('features/context-pad', function() {
image.onerror = function(error) {
done(error);
};
});

test();
})();
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/spec/features/copy-paste/CopyPasteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ describe('features/copy-paste', function() {
});


it('should fire <copyPaste.pasteElements> event when pasting elements', function(done) {
it('should fire <copyPaste.pasteElement> event when pasting elements', function(done) {
getDiagramJS().invoke(function(copyPaste, elementFactory, eventBus) {

// given
Expand Down
2 changes: 1 addition & 1 deletion test/spec/features/modeling/MoveShapeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe('features/modeling - move shape', function() {
}));


it('execute', inject(function(modeling, commandStack) {
it('redo', inject(function(modeling, commandStack) {

// given
modeling.moveShape(childShape, { x: -20, y: +20 }, rootShape, 0);
Expand Down
11 changes: 5 additions & 6 deletions test/spec/features/overlays/OverlaysSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ describe('features/overlays', function() {
}


it('should position top left of shape', inject(function(overlays) {
it(' (connection)', inject(function(overlays) {

var html = createOverlay();

Expand Down Expand Up @@ -533,7 +533,8 @@ describe('features/overlays', function() {

}));

it('should position top left of shape', inject(function(overlays, canvas) {

it('should position top left of connection', inject(function(overlays, canvas) {

var html = createOverlay();

Expand Down Expand Up @@ -1176,7 +1177,7 @@ describe('features/overlays', function() {

function verifyScale(overlayConfig, expectedScales) {

var test = inject(function(canvas, overlays) {
inject(function(canvas, overlays) {

// given
var shape = canvas.addShape({
Expand Down Expand Up @@ -1218,9 +1219,7 @@ describe('features/overlays', function() {
expect(effectiveScale).to.be.closeTo(expectedScale, 0.00001);
});

});

test();
})();
}


Expand Down
23 changes: 0 additions & 23 deletions test/spec/features/resize/ResizeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,29 +313,6 @@ describe('features/resize - Resize', function() {
}));


it('should resize to minimum bounds', inject(function(canvas, resize, dragging, elementFactory) {

// given
var shape = elementFactory.createShape({
id: 'shapeA',
resizable: 'always',
x: 100, y: 100, width: 100, height: 100
});

shape = canvas.addShape(shape);

// when
resize.activate(canvasEvent({ x: 0, y: 0 }), shape, 'se');
dragging.move(canvasEvent({ x: -99, y: -99 }));
dragging.end();

// then
var shapeBounds = pick(shape, [ 'x', 'y', 'width', 'height' ]);

expect(shapeBounds).to.eql({ x: 100, y: 100, width: 10, height: 10 });
}));


it('should not resize due to rules', inject(function(resize, canvas, dragging, elementFactory) {

// given
Expand Down
55 changes: 0 additions & 55 deletions test/spec/features/resize/ResizeUtilSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,61 +329,6 @@ describe('resize/ResizeUtil', function() {
});


describe('getMinResizeBounds', function() {

var currentBounds = {
x: 100, y: 100,
width: 100, height: 100
};

var minDimensions = {
width: 50, height: 50
};


it('should give min bounds for "nw"', function() {

// when
var newBounds = getMinResizeBounds('nw', currentBounds, minDimensions);

// then
expect(newBounds).to.eql({ x: 150, y: 150, width: 50, height: 50 });
});


it('should give min bounds for "sw"', function() {

// when
var newBounds = getMinResizeBounds('sw', currentBounds, minDimensions);

// then
expect(newBounds).to.eql({ x: 150, y: 100, width: 50, height: 50 });
});


it('should give min bounds for "ne"', function() {

// when
var newBounds = getMinResizeBounds('ne', currentBounds, minDimensions);

// then
expect(newBounds).to.eql({ x: 100, y: 150, width: 50, height: 50 });
});


it('should give min bounds for "se"', function() {

// when
var newBounds = getMinResizeBounds('se', currentBounds, minDimensions);

// then
expect(newBounds).to.eql({ x: 100, y: 100, width: 50, height: 50 });
});


});


describe('addPadding', function() {

var bounds = {
Expand Down
5 changes: 0 additions & 5 deletions test/spec/i18n/translate/translateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ describe('i18n - translate', function() {
expect(translate('<div />')).to.eql('<div />');
}));


it('should handle missing replacement', inject(function(translate) {
expect(translate('FOO {bar}!', {})).to.eql('FOO {bar}!');
}));

});


Expand Down
76 changes: 45 additions & 31 deletions test/spec/layout/ManhattanLayoutSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,19 @@ describe('layout/ManhattanLayout', function() {
* |
* x
*/
describe('manhattan connection with 3 waypoints', function() {
describe('manhattan connection with 3 waypoints (a)', function() {

var waypoints = [ a, point(200, 100), b ];


it('h:v', expectConnectionWaypoints(a, b, 'h:v', waypoints));
it('r:v', expectConnectionWaypoints(a, b, 'r:v', waypoints));
it('r:t', expectConnectionWaypoints(a, b, 'r:t', waypoints));
it('h:t', expectConnectionWaypoints(a, b, 'h:t', waypoints));
it('h:v (a)', expectConnectionWaypoints(a, b, 'h:v', waypoints));

it('r:v (a)', expectConnectionWaypoints(a, b, 'r:v', waypoints));

it('r:t (a)', expectConnectionWaypoints(a, b, 'r:t', waypoints));

it('h:t (a)', expectConnectionWaypoints(a, b, 'h:t', waypoints));

});


Expand All @@ -64,15 +68,18 @@ describe('layout/ManhattanLayout', function() {
* |
* x----x
*/
describe('manhattan connection with 3 waypoints', function() {
describe('manhattan connection with 3 waypoints (b)', function() {

var waypoints = [ a, point(100, 200), b ];


it('v:h', expectConnectionWaypoints(a, b, 'v:h', waypoints));
it('b:h', expectConnectionWaypoints(a, b, 'b:h', waypoints));
it('b:l', expectConnectionWaypoints(a, b, 'b:l', waypoints));
it('v:l', expectConnectionWaypoints(a, b, 'v:l', waypoints));
it('v:h (b)', expectConnectionWaypoints(a, b, 'v:h', waypoints));

it('b:h (b)', expectConnectionWaypoints(a, b, 'b:h', waypoints));

it('b:l (b)', expectConnectionWaypoints(a, b, 'b:l', waypoints));

it('v:l (b)', expectConnectionWaypoints(a, b, 'v:l', waypoints));
});


Expand All @@ -82,15 +89,18 @@ describe('layout/ManhattanLayout', function() {
* |
* x--x
*/
describe('manhattan connection with 4 waypoints', function() {
describe('manhattan connection with 4 waypoints (a)', function() {

var waypoints = [ a, point(150, 100), point(150, 200), b ];


it('h:h', expectConnectionWaypoints(a, b, 'h:h', waypoints));
it('r:h', expectConnectionWaypoints(a, b, 'r:h', waypoints));
it('r:l', expectConnectionWaypoints(a, b, 'r:l', waypoints));
it('h:l', expectConnectionWaypoints(a, b, 'h:l', waypoints));
it('h:h (a)', expectConnectionWaypoints(a, b, 'h:h', waypoints));

it('r:h (a)', expectConnectionWaypoints(a, b, 'r:h', waypoints));

it('r:l (a)', expectConnectionWaypoints(a, b, 'r:l', waypoints));

it('h:l (a)', expectConnectionWaypoints(a, b, 'h:l', waypoints));
});


Expand All @@ -100,13 +110,14 @@ describe('layout/ManhattanLayout', function() {
* |
* x-x
*/
describe('manhattan connection with 4 waypoints', function() {
describe('manhattan connection with 4 waypoints (b)', function() {

var waypoints = [ a, point(220, 100), point(220, 200), b ];


it('h:r', expectConnectionWaypoints(a, b, 'h:r', waypoints));
it('r:r', expectConnectionWaypoints(a, b, 'r:r', waypoints));
it('h:r (b)', expectConnectionWaypoints(a, b, 'h:r', waypoints));

it('r:r (b)', expectConnectionWaypoints(a, b, 'r:r', waypoints));
});


Expand All @@ -116,13 +127,14 @@ describe('layout/ManhattanLayout', function() {
* |
* x----x
*/
describe('manhattan connection with 4 waypoints', function() {
describe('manhattan connection with 4 waypoints (c)', function() {

var waypoints = [ a, point(80, 100), point(80, 200), b ];


it('l:h', expectConnectionWaypoints(a, b, 'l:h', waypoints));
it('l:l', expectConnectionWaypoints(a, b, 'l:l', waypoints));
it('l:h (c)', expectConnectionWaypoints(a, b, 'l:h', waypoints));

it('l:l (c)', expectConnectionWaypoints(a, b, 'l:l', waypoints));
});


Expand All @@ -133,13 +145,14 @@ describe('layout/ManhattanLayout', function() {
* |
* x--x
*/
describe('manhattan connection with 5 waypoints', function() {
describe('manhattan connection with 5 waypoints (a)', function() {

var waypoints = [ a, point(100, 80), point(150, 80), point(150, 200), b ];


it('t:h', expectConnectionWaypoints(a, b, 't:h', waypoints));
it('t:l', expectConnectionWaypoints(a, b, 't:l', waypoints));
it('t:h (a)', expectConnectionWaypoints(a, b, 't:h', waypoints));

it('t:l (a)', expectConnectionWaypoints(a, b, 't:l', waypoints));
});


Expand All @@ -150,13 +163,14 @@ describe('layout/ManhattanLayout', function() {
* | |
* x--x
*/
describe('manhattan connection with 5 waypoints', function() {
describe('manhattan connection with 5 waypoints (b)', function() {

var waypoints = [ a, point(150, 100), point(150, 220), point(200, 220), b ];


it('h:b', expectConnectionWaypoints(a, b, 'h:b', waypoints));
it('r:b', expectConnectionWaypoints(a, b, 'r:b', waypoints));
it('h:b (b)', expectConnectionWaypoints(a, b, 'h:b', waypoints));

it('r:b (b)', expectConnectionWaypoints(a, b, 'r:b', waypoints));
});


Expand All @@ -167,12 +181,12 @@ describe('layout/ManhattanLayout', function() {
* |
* x-x
*/
describe('manhattan connection with 6 waypoints', function() {
describe('manhattan connection with 6 waypoints (a)', function() {

var waypoints = [ a, point(80, 100), point(80, 150), point(220, 150), point(220, 200), b ];


it('l:r', expectConnectionWaypoints(a, b, 'l:r', waypoints));
it('l:r (a)', expectConnectionWaypoints(a, b, 'l:r', waypoints));
});


Expand All @@ -183,12 +197,12 @@ describe('layout/ManhattanLayout', function() {
* | |
* x--x
*/
describe('manhattan connection with 6 waypoints', function() {
describe('manhattan connection with 6 waypoints (b)', function() {

var waypoints = [ a, point(100, 80), point(150, 80), point(150, 220), point(200, 220), b ];


it('t:b', expectConnectionWaypoints(a, b, 't:b', waypoints));
it('t:b (b)', expectConnectionWaypoints(a, b, 't:b', waypoints));
});


Expand Down
Loading

0 comments on commit 4a94f42

Please sign in to comment.