mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-29 02:04:55 +00:00
390031a7c3
* update embedded label bounds on shape move * remove embedded label bounds on shape resize Related to https: //github.com/camunda/camunda-modeler/issues/2591 Co-Authored-By: Martin Stamm <martin.stamm@camunda.com> Co-Authored-By: Philipp Fromme <philippfromme@outlook.com>
72 lines
1.3 KiB
JavaScript
72 lines
1.3 KiB
JavaScript
import {
|
|
bootstrapModeler,
|
|
inject
|
|
} from 'test/TestHelper';
|
|
|
|
import coreModule from 'lib/core';
|
|
import modelingModule from 'lib/features/modeling';
|
|
|
|
import { getDi } from 'lib/util/ModelUtil';
|
|
|
|
|
|
describe('features/modeling - RemoveEmbeddedLabelBoundsBehavior', function() {
|
|
|
|
var processDiagramXML = require('./RemoveEmbeddedLabelBoundsBehavior.bpmn');
|
|
|
|
beforeEach(bootstrapModeler(processDiagramXML, {
|
|
modules: [
|
|
coreModule,
|
|
modelingModule
|
|
]
|
|
}));
|
|
|
|
var bounds,
|
|
di;
|
|
|
|
beforeEach(inject(function(elementRegistry, modeling) {
|
|
|
|
// given
|
|
var subProcess = elementRegistry.get('Activity_1');
|
|
|
|
di = getDi(subProcess);
|
|
|
|
bounds = di.get('label').get('bounds');
|
|
|
|
// when
|
|
modeling.resizeShape(subProcess, {
|
|
x: 0,
|
|
y: 0,
|
|
width: 100,
|
|
height: 100
|
|
});
|
|
}));
|
|
|
|
|
|
it('<do>', function() {
|
|
|
|
// then
|
|
expect(di.get('label').get('bounds')).not.to.exist;
|
|
});
|
|
|
|
|
|
it('<undo>', inject(function(commandStack) {
|
|
|
|
// when
|
|
commandStack.undo();
|
|
|
|
// then
|
|
expect(di.get('label').get('bounds')).to.equal(bounds);
|
|
}));
|
|
|
|
|
|
it('<redo>', inject(function(commandStack) {
|
|
|
|
// when
|
|
commandStack.undo();
|
|
commandStack.redo();
|
|
|
|
// then
|
|
expect(di.get('label').get('bounds')).not.to.exist;
|
|
}));
|
|
|
|
}); |