Skip to content

Commit

Permalink
test(selection-visuals): adjust marker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Kiefer committed Oct 24, 2018
1 parent c7f8f1a commit 242aed0
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions test/spec/features/selection/SelectionVisualsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import selectionModule from 'lib/features/selection';

import {
query as domQuery
matches
} from 'min-dom';


Expand All @@ -27,7 +27,7 @@ describe('features/selection/SelectionVisuals', function() {

describe('selection box', function() {

var shape, shape2, connection;
var shape, shape2, connection, label;

beforeEach(inject(function(elementFactory, canvas) {

Expand All @@ -53,6 +53,14 @@ describe('features/selection/SelectionVisuals', function() {
});

canvas.addConnection(connection);

label = elementFactory.createLabel({
id: 'label',
x: 250, y: 200, width: 20, height: 20,
labelTarget: connection
});

canvas.addShape(label);
}));


Expand All @@ -63,11 +71,39 @@ describe('features/selection/SelectionVisuals', function() {

// then
var gfx = canvas.getGraphics(connection),
outline = domQuery('.djs-outline', gfx);
hasOutline = matches(gfx, '.selected');

expect(outline).to.exist;
expect(hasOutline).to.be.true;
}));


it('should show box on connection-labels on select',
inject(function(selection, canvas) {

// when
selection.select(connection);

// then
var gfx = canvas.getGraphics(label),
hasOutline = matches(gfx, '.selected');

expect(hasOutline).to.be.true;
}));


it('should show box on connection on selecting label',
inject(function(selection, canvas) {

// when
selection.select(label);

// then
var gfx = canvas.getGraphics(connection),
hasOutline = matches(gfx, '.selected');

expect(hasOutline).to.be.true;
}));

});

});

0 comments on commit 242aed0

Please sign in to comment.