How to use the bpmn-js/test/helper.getBpmnJS 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__ / CustomPaletteProviderSpec.js View on Github external
function triggerPaletteEntry(id) {
  getBpmnJS().invoke(function(palette) {
    var entry = palette.getEntries()[ id ];

    if (entry && entry.action && entry.action.click) {
      entry.action.click(createMoveEvent(0, 0));
    }
  });
}
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / __tests__ / CustomContextPadProviderSpec.js View on Github external
function getContextPadEntries(elementId) {
      let entries;

      getBpmnJS().invoke(function(elementRegistry, contextPad) {
        const element = elementRegistry.get(elementId);

        contextPad.open(element, true);

        entries = contextPad._current.entries;
      });

      return Object.keys(entries);
    }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / __tests__ / CustomRulesSpec.js View on Github external
const expectCanAttach = (elements, target, rules) => {

  let results = {};

  getBpmnJS().invoke(function(bpmnRules) {

    target = get(target);

    if ('attach' in rules) {
      results.attach = bpmnRules.canAttach(elements, target);
    }
  });

  expect(results).to.eql(rules);
};
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / __tests__ / CustomRulesSpec.js View on Github external
const get = (element) => {

  let actualElement;

  if (isString(element)) {
    actualElement = getBpmnJS().invoke(function(elementRegistry) {
      return elementRegistry.get(element);
    });

    if (!actualElement) {
      throw new Error('element #' + element + ' not found');
    }

    return actualElement;
  }

  return element;
};
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / __tests__ / CustomContextPadProviderSpec.js View on Github external
const padEvent = entry => {

  return getBpmnJS().invoke(function(overlays) {

    const target = padEntry(overlays._overlayRoot, entry);

    return {
      target: target,
      preventDefault: () => {},
      clientX: 100,
      clientY: 100
    };
  });
};
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / __tests__ / CustomReplaceMenuProviderSpec.js View on Github external
const openPopup = (element, offset) => {
  offset = offset || 100;

  getBpmnJS().invoke(function(popupMenu) {

    popupMenu.open(element, 'bpmn-replace', {
      x: element.x + offset, y: element.y + offset
    });

  });
};