bpmn-js/test/spec/features/label-editing/TouchIntegrationSpec.js
Nico Rehwaldt 04ca31fac9 feat(lib): Promisify public APIs
This commit promisifies following APIs:

   BaseViewer#importXML
   BaseViewer#importDefinitions
   BaseViewer#open
   BaseViewer#saveXML
   BaseViewer#saveSVG
   Modeler#createDiagram

Related to https://github.com/bpmn-io/bpmn-js/issues/812

BREAKING CHANGES:

* Users are now expected to have Promises either by default or
polyfilled as the APIs return a Promise now.
2020-04-29 11:12:23 +02:00

42 lines
995 B
JavaScript

import TestContainer from 'mocha-test-container-support';
import Modeler from 'lib/Modeler';
describe('direct editing - touch integration', function() {
var container;
beforeEach(function() {
container = TestContainer.get(this);
});
function createModeler(xml) {
var modeler = new Modeler({ container: container });
return modeler.importXML(xml).then(function(result) {
return { error: null, modeler: modeler };
}).catch(function(err) {
return { error: err, modeler: modeler };
});
}
it('should work on modeler (manual test)', function() {
var xml = require('../../../fixtures/bpmn/simple.bpmn');
return createModeler(xml).then(function(result) {
expect(result.error).not.to.exist;
});
});
it('should edit labels via double tap (manual test)', function() {
var xml = require('./LabelEditing.bpmn');
return createModeler(xml).then(function(result) {
expect(result.error).not.to.exist;
});
});
});