Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('in the DOM', function() {
it('should execute', function() {
// then
expect(input.value).to.equal('foo');
});
it('should undo', inject(function(commandStack) {
// when
commandStack.undo();
// then
expect(input.value).to.equal('retries');
}));
it('should redo', inject(function(commandStack) {
// when
commandStack.undo();
commandStack.redo();
// then
describe('on the business object', function() {
it('should execute', function() {
// then
expect(timerDefinition.timeDuration).to.be.ok;
});
it('should undo', inject(function(commandStack) {
// when
commandStack.undo();
// then
expect(timerDefinition.timeDuration).not.to.be.ok;
}));
it('should redo', inject(function(commandStack) {
// when
commandStack.undo();
commandStack.redo();
// then
collapsedSubProcessEntry = queryEntry(popupMenu, 'replace-with-collapsed-subprocess'),
expandedSubProcessEntry = queryEntry(popupMenu, 'replace-with-expanded-subprocess'),
sequentialMultiInstanceEntry = queryEntry(popupMenu, 'toggle-parallel-mi'),
parallelMultiInstanceEntry = queryEntry(popupMenu, 'toggle-sequential-mi');
// then
expect(collapsedSubProcessEntry).to.exist;
expect(expandedSubProcessEntry).to.exist;
expect(receiveTaskEntry).to.exist;
expect(sequentialMultiInstanceEntry).to.exist;
expect(parallelMultiInstanceEntry).to.exist;
}));
it('should contain options for EventBasedGateway', inject(function(
popupMenu, elementRegistry) {
// given
const eventBasedGateway = elementRegistry.get('EventBasedGateway_1');
openPopup(eventBasedGateway);
const exclusiveGatewayEntry = queryEntry(popupMenu, 'replace-with-exclusive-gateway'),
parallelGatewayEntry = queryEntry(popupMenu, 'replace-with-parallel-gateway');
// then
expect(exclusiveGatewayEntry).to.exist;
expect(parallelGatewayEntry).to.exist;
}));
});
it('should undo', inject(function(commandStack) {
// when
commandStack.undo();
// then
const calledElement = getCalledElement(bo);
expect(calledElement).to.be.undefined;
}));
it('should redo', inject(function(commandStack) {
// when
commandStack.undo();
commandStack.redo();
// then
const calledElement = getCalledElement(bo);
expect(calledElement).to.exist;
expect(calledElement.processId).to.equal('foo');
}));
});
it('should activate lasso tool', inject(function(dragging) {
// when
triggerPaletteEntry('lasso-tool');
// then
const context = dragging.context(),
prefix = context.prefix;
expect(prefix).to.equal('lasso.selection');
}));
it('should activate space tool', inject(function(dragging) {
// when
triggerPaletteEntry('space-tool');
// then
const context = dragging.context(),
prefix = context.prefix;
expect(prefix).to.equal('spaceTool.selection');
}));
it('should activate global-connect tool', inject(function(dragging) {
// when
triggerPaletteEntry('global-connect-tool');
zeebe: zeebeModdleExtensions
};
let container;
beforeEach(function() {
container = TestContainer.get(this);
});
beforeEach(bootstrapModeler(diagramXML, {
modules: testModules,
moddleExtensions
}));
beforeEach(inject(function(commandStack, propertiesPanel) {
const undoButton = document.createElement('button');
undoButton.textContent = 'UNDO';
undoButton.addEventListener('click', () => {
commandStack.undo();
});
container.appendChild(undoButton);
propertiesPanel.attachTo(container);
}));
it('should fetch empty list of input and output parameters', inject(function(selection, elementRegistry) {
// given
describe('of time date', function() {
let input, timeDate;
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('TIME_DATE');
selection.select(shape);
const bo = getBusinessObject(shape);
const timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
timeDate = timerDefinition.timeDate;
input = getTimerDefinitionField(container);
// when
triggerValue(input, 'foo', 'change');
}));
describe('in the DOM', function() {
describe('creation', function() {
let bo;
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('SequenceFlow_1');
selection.select(shape);
bo = getBusinessObject(shape);
// assume
expect(getConditionExpression(bo)).to.be.undefined;
const input = getInputField(container, 'zeebe-condition', 'condition');
// when
triggerValue(input, 'foo', 'change');
}));
describe('change timer definition', function() {
let container;
beforeEach(inject(function(propertiesPanel) {
container = propertiesPanel._container;
}));
describe('of time duration', function() {
let input, timeDuration;
beforeEach(inject(function(elementRegistry, selection) {
// given
const shape = elementRegistry.get('TIME_DURATION');
selection.select(shape);
const bo = getBusinessObject(shape);
const timerDefinition = eventDefinitionHelper.getTimerEventDefinition(bo);
timeDuration = timerDefinition.timeDuration;
it('should execute', function() {
expect(errorEventDefinition.errorRef.name).to.equal('Error1');
});
it('should undo', inject(function(commandStack) {
commandStack.undo();
expect(errorEventDefinition.errorRef.name).to.equal('Error2');
}));
it('should redo', inject(function(commandStack) {
commandStack.undo();
commandStack.redo();
expect(errorEventDefinition.errorRef.name).to.equal('Error1');
}));
});