How to use the bpmn-js/test/helper.bootstrapModeler function in bpmn-js

To help you get started, we’ve selected a few bpmn-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / __tests__ / CustomReplaceMenuProviderSpec.js View on Github external
describe('customs - replaceMenu', function() {

  const diagramXML = require('./diagram.bpmn');

  beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));

  it('should contain options for StartEvent', inject(function(
      popupMenu, elementRegistry) {

    // given
    const startEvent = elementRegistry.get('StartEvent_1');

    openPopup(startEvent);

    const endEventEntry = queryEntry(popupMenu, 'replace-with-none-end'),
          messageStartEntry = queryEntry(popupMenu, 'replace-with-message-start'),
          timerStartEntry = queryEntry(popupMenu, 'replace-with-timer-start');

    // then
    expect(endEventEntry).to.exist;
    expect(messageStartEntry).to.exist;
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / modeling / __tests__ / CreateZeebeBoundaryEventBehaviorSpec.js View on Github external
describe('features/modeling/behavior - create boundary events', function() {

  const testModules = [
    coreModule,
    contextPadModule,
    paletteModule,
    modelingModule,
    customModelingModule,
    customModules
  ];

  const processDiagramXML = require('./process-empty.bpmn');

  beforeEach(bootstrapModeler(processDiagramXML, { modules: testModules }));

  it('should execute on attach', inject(function(canvas, elementFactory, modeling, bpmnFactory) {

    // given
    const messageEventDefinition = bpmnFactory.create('bpmn:MessageEventDefinition');

    const messageIntermediateCatchEvent = bpmnFactory.create('bpmn:IntermediateCatchEvent', {
      eventDefinitions: [ messageEventDefinition ]
    });

    const intermediateEvent = elementFactory.create('shape', {
      id: messageIntermediateCatchEvent.id,
      businessObject: messageIntermediateCatchEvent
    });

    const rootElement = canvas.getRootElement(),
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / __tests__ / CustomPaletteProviderSpec.js View on Github external
describe('customs - palette', function() {

  const diagramXML = require('./diagram.bpmn');

  beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));

  it('should provide zeebe related entries', inject(function(canvas) {

    // when
    const paletteElement = domQuery('.djs-palette', canvas._container);
    const entries = domQueryAll('.entry', paletteElement);

    // then
    expect(entries.length).to.equal(12);
  }));


  it('should activate hand tool', inject(function(dragging) {

    // when
    triggerPaletteEntry('hand-tool');
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / __tests__ / TimerDurationSpec.js View on Github external
const diagramXML = require('./TimerDuration.bpmn');

  const testModules = [
    coreModule, selectionModule, modelingModule,
    propertiesPanelModule,
    propertiesProviderModule
  ];

  let container;

  beforeEach(function() {
    container = TestContainer.get(this);
  });

  beforeEach(bootstrapModeler(diagramXML, {
    modules: testModules
  }));


  beforeEach(inject(function(commandStack, propertiesPanel) {

    const undoButton = document.createElement('button');
    undoButton.textContent = 'UNDO';

    undoButton.addEventListener('click', () => {
      commandStack.undo();
    });

    container.appendChild(undoButton);

    propertiesPanel.attachTo(container);
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / __tests__ / TaskDefinitionSpec.js View on Github external
coreModule, selectionModule, modelingModule,
    propertiesPanelModule,
    propertiesProviderModule
  ];

  const moddleExtensions = {
    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);
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / __tests__ / MessageSpec.js View on Github external
coreModule, selectionModule, modelingModule,
    propertiesPanelModule,
    propertiesProviderModule
  ];

  const moddleExtensions = {
    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);
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / __tests__ / SequenceFlowSpec.js View on Github external
const diagramXML = require('./SequenceFlow.bpmn');

  const testModules = [
    coreModule, selectionModule, modelingModule,
    propertiesPanelModule,
    propertiesProviderModule
  ];

  let container;

  beforeEach(function() {
    container = TestContainer.get(this);
  });

  beforeEach(bootstrapModeler(diagramXML, {
    modules: testModules
  }));


  beforeEach(inject(function(commandStack, propertiesPanel) {

    const undoButton = document.createElement('button');
    undoButton.textContent = 'UNDO';

    undoButton.addEventListener('click', () => {
      commandStack.undo();
    });

    container.appendChild(undoButton);

    propertiesPanel.attachTo(container);
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / __tests__ / HeadersSpec.js View on Github external
coreModule, selectionModule, modelingModule,
    propertiesPanelModule,
    propertiesProviderModule
  ];

  const moddleExtensions = {
    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);
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / __tests__ / MultiInstanceLoopSpec.js View on Github external
coreModule, selectionModule, modelingModule,
    propertiesPanelModule,
    propertiesProviderModule
  ];

  const moddleExtensions = {
    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);
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / __tests__ / StartEventTimerEventDefinitionSpec.js View on Github external
const diagramXML = require('./StartEventTimerEventDefinition.bpmn');

  const testModules = [
    coreModule, selectionModule, modelingModule,
    propertiesPanelModule,
    propertiesProviderModule
  ];

  let container;

  beforeEach(function() {
    container = TestContainer.get(this);
  });

  beforeEach(bootstrapModeler(diagramXML, {
    modules: testModules
  }));


  beforeEach(inject(function(commandStack, propertiesPanel) {

    const undoButton = document.createElement('button');
    undoButton.textContent = 'UNDO';

    undoButton.addEventListener('click', function() {
      commandStack.undo();
    });

    container.appendChild(undoButton);

    propertiesPanel.attachTo(container);