bpmn-js/test/spec/NavigatedViewerSpec.js

55 lines
1.1 KiB
JavaScript
Raw Normal View History

import NavigatedViewer from 'lib/NavigatedViewer';
import TestContainer from 'mocha-test-container-support';
describe('NavigatedViewer', function() {
var container;
beforeEach(function() {
container = TestContainer.get(this);
});
function createViewer(xml, done) {
var viewer = new NavigatedViewer({
container: container
});
viewer.importXML(xml, function(err, warnings) {
done(err, warnings, viewer);
});
}
it('should import simple process', function(done) {
var xml = require('../fixtures/bpmn/simple.bpmn');
createViewer(xml, done);
});
describe('navigation features', function() {
var xml = require('../fixtures/bpmn/simple.bpmn');
it('should include zoomScroll', function(done) {
createViewer(xml, function(err, warnings, viewer) {
expect(viewer.get('zoomScroll')).to.exist;
done(err);
});
});
it('should include moveCanvas', function(done) {
createViewer(xml, function(err, warnings, viewer) {
expect(viewer.get('moveCanvas')).to.exist;
done(err);
});
});
});
});