diagram-js
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -177,3 +177,3 @@ var _ = require('lodash'); | ||
y = bbox.y, | ||
height = bbox.height || 0, | ||
height = bbox.height || 0, | ||
width = bbox.width || 0; | ||
@@ -180,0 +180,0 @@ |
{ | ||
"name": "diagram-js", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "A modeling framework for the web", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -90,7 +90,18 @@ 'use strict'; | ||
it('should show resize box', inject(function(lassoTool, canvas, dragging) { | ||
beforeEach(inject(function(dragging) { | ||
dragging.setOptions({ manual: true }); | ||
})); | ||
var createEvent; | ||
beforeEach(inject(function(canvas) { | ||
createEvent = Events.scopedCreate(canvas); | ||
})); | ||
it('should show lasso box', inject(function(lassoTool, canvas, dragging) { | ||
// when | ||
lassoTool.activate(Events.create(canvas._svg, { x: 100, y: 100 })); | ||
dragging.move(Events.create(canvas._svg, { x: 200, y: 300 })); | ||
lassoTool.activate(createEvent({ x: 100, y: 100 })); | ||
dragging.move(createEvent({ x: 200, y: 300 })); | ||
@@ -101,4 +112,16 @@ // then | ||
it('should select after lasso', inject(function(lassoTool, dragging, selection, elementRegistry) { | ||
// when | ||
lassoTool.activate(createEvent({ x: 100, y: 100 })); | ||
dragging.move(createEvent({ x: 200, y: 300 })); | ||
dragging.end(); | ||
// then | ||
expect(selection.get()).toEqual([ elementRegistry.get('child') ]); | ||
})); | ||
}); | ||
}); |
'use strict'; | ||
var TestHelper = require('../../../TestHelper'); | ||
require('../../../TestHelper'); | ||
@@ -9,3 +9,2 @@ /* global bootstrapDiagram, inject */ | ||
var selectionModule = require('../../../../lib/features/selection'); | ||
var overlayModule = require('../../../../lib/features/overlays'); | ||
@@ -15,2 +14,4 @@ | ||
beforeEach(bootstrapDiagram({ modules: [ selectionModule ] })); | ||
describe('bootstrap', function() { | ||
@@ -25,2 +26,49 @@ | ||
}); | ||
ddescribe('selection box', function() { | ||
var shape, shape2, connection; | ||
beforeEach(inject(function(elementFactory, canvas) { | ||
shape = elementFactory.createShape({ | ||
id: 'child', | ||
x: 100, y: 100, width: 100, height: 100 | ||
}); | ||
canvas.addShape(shape); | ||
shape2 = elementFactory.createShape({ | ||
id: 'child2', | ||
x: 300, y: 100, width: 100, height: 100 | ||
}); | ||
canvas.addShape(shape2); | ||
connection = elementFactory.createConnection({ | ||
id: 'connection', | ||
waypoints: [ { x: 150, y: 150 }, { x: 150, y: 200 }, { x: 350, y: 150 } ], | ||
source: shape, | ||
target: shape2 | ||
}); | ||
canvas.addConnection(connection); | ||
})); | ||
it('should show box on select', inject(function(selection, canvas) { | ||
// when | ||
selection.select(connection); | ||
// then | ||
var gfx = canvas.getGraphics(connection), | ||
outline = gfx.select('.djs-outline'); | ||
expect(outline).toBeDefined(); | ||
})); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
484829
14717