mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-18 11:56:30 +00:00
test(draw): nest path tests
This commit is contained in:
parent
17c074464c
commit
04d8ef8a18
@ -148,70 +148,71 @@ describe('draw - bpmn renderer', function() {
|
|||||||
bootstrapViewer(xml)(done);
|
bootstrapViewer(xml)(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('path - bpmn renderer', function () {
|
describe('path', function () {
|
||||||
|
|
||||||
var diagramXML = require('../../fixtures/bpmn/simple-cropping.bpmn');
|
var diagramXML = require('../../fixtures/bpmn/simple-cropping.bpmn');
|
||||||
|
|
||||||
var testModules = [ coreModule, rendererModule ];
|
var testModules = [ coreModule, rendererModule ];
|
||||||
|
|
||||||
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
|
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
|
||||||
|
|
||||||
describe('circle', function () {
|
describe('circle', function () {
|
||||||
|
|
||||||
|
|
||||||
it('should return a circle path', inject(function(canvas, elementRegistry, graphicsFactory) {
|
it('should return a circle path', inject(function(canvas, elementRegistry, graphicsFactory) {
|
||||||
|
|
||||||
// given
|
// given
|
||||||
var eventElement = elementRegistry.get('StartEvent_1');
|
var eventElement = elementRegistry.get('StartEvent_1');
|
||||||
|
|
||||||
// when
|
// when
|
||||||
var startPath = graphicsFactory.getShapePath(eventElement);
|
var startPath = graphicsFactory.getShapePath(eventElement);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(startPath).to.equal('M247,343m0,-18a18,18,0,1,1,0,36a18,18,0,1,1,0,-36z');
|
expect(startPath).to.equal('M247,343m0,-18a18,18,0,1,1,0,36a18,18,0,1,1,0,-36z');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
it('should return a diamond path', inject(function(canvas, elementRegistry, graphicsFactory) {
|
it('should return a diamond path', inject(function(canvas, elementRegistry, graphicsFactory) {
|
||||||
|
|
||||||
// given
|
// given
|
||||||
var gatewayElement = elementRegistry.get('ExclusiveGateway_1');
|
var gatewayElement = elementRegistry.get('ExclusiveGateway_1');
|
||||||
|
|
||||||
// when
|
// when
|
||||||
var gatewayPath = graphicsFactory.getShapePath(gatewayElement);
|
var gatewayPath = graphicsFactory.getShapePath(gatewayElement);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(gatewayPath).to.equal('M418,318l25,25l-25,25l-25,-25z');
|
expect(gatewayPath).to.equal('M418,318l25,25l-25,25l-25,-25z');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
it('should return a rounded rectangular path', inject(function(canvas, elementRegistry, graphicsFactory) {
|
it('should return a rounded rectangular path', inject(function(canvas, elementRegistry, graphicsFactory) {
|
||||||
|
|
||||||
// given
|
// given
|
||||||
var subProcessElement = elementRegistry.get('SubProcess_1');
|
var subProcessElement = elementRegistry.get('SubProcess_1');
|
||||||
|
|
||||||
// when
|
// when
|
||||||
var subProcessPath = graphicsFactory.getShapePath(subProcessElement);
|
var subProcessPath = graphicsFactory.getShapePath(subProcessElement);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(subProcessPath).to.equal('M584,243l330,0a10,10,0,0,1,10,10l0,180a10,10,0,0,1,-10,10' +
|
expect(subProcessPath).to.equal('M584,243l330,0a10,10,0,0,1,10,10l0,180a10,10,0,0,1,-10,10' +
|
||||||
'l-330,0a10,10,0,0,1,-10,-10l0,-180a10,10,0,0,1,10,-10z');
|
'l-330,0a10,10,0,0,1,-10,-10l0,-180a10,10,0,0,1,10,-10z');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
it('should return a rectangular path', inject(function(canvas, elementRegistry, graphicsFactory) {
|
it('should return a rectangular path', inject(function(canvas, elementRegistry, graphicsFactory) {
|
||||||
|
|
||||||
// given
|
// given
|
||||||
var TextAnnotationElement = elementRegistry.get('TextAnnotation_1');
|
var TextAnnotationElement = elementRegistry.get('TextAnnotation_1');
|
||||||
|
|
||||||
// when
|
// when
|
||||||
var TextAnnotationPath = graphicsFactory.getShapePath(TextAnnotationElement);
|
var TextAnnotationPath = graphicsFactory.getShapePath(TextAnnotationElement);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
expect(TextAnnotationPath).to.equal('M368,156l100,0l0,80l-100,0z');
|
expect(TextAnnotationPath).to.equal('M368,156l100,0l0,80l-100,0z');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user