2015-01-10 11:04:26 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-06-07 06:46:45 +00:00
|
|
|
require('../TestHelper');
|
2015-01-10 11:04:26 +00:00
|
|
|
|
2018-01-24 10:41:21 +00:00
|
|
|
var NavigatedViewer = require('lib/NavigatedViewer');
|
2015-01-10 11:04:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
describe('NavigatedViewer', function() {
|
|
|
|
|
|
|
|
var container;
|
|
|
|
|
|
|
|
beforeEach(function() {
|
2015-07-15 15:22:19 +00:00
|
|
|
container = document.createElement('div');
|
|
|
|
document.body.appendChild(container);
|
2015-01-10 11:04:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2015-07-15 15:22:19 +00:00
|
|
|
|
2015-01-10 11:04:26 +00:00
|
|
|
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) {
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../fixtures/bpmn/simple.bpmn');
|
2015-01-10 11:04:26 +00:00
|
|
|
createViewer(xml, done);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
describe('navigation features', function() {
|
|
|
|
|
2015-03-31 12:17:15 +00:00
|
|
|
var xml = require('../fixtures/bpmn/simple.bpmn');
|
2015-01-10 11:04:26 +00:00
|
|
|
|
|
|
|
it('should include zoomScroll', function(done) {
|
2015-03-31 12:17:15 +00:00
|
|
|
|
2015-01-10 11:04:26 +00:00
|
|
|
createViewer(xml, function(err, warnings, viewer) {
|
2015-12-01 07:27:45 +00:00
|
|
|
expect(viewer.get('zoomScroll')).to.exist;
|
2015-01-10 11:04:26 +00:00
|
|
|
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('should include moveCanvas', function(done) {
|
|
|
|
createViewer(xml, function(err, warnings, viewer) {
|
2015-12-01 07:27:45 +00:00
|
|
|
expect(viewer.get('moveCanvas')).to.exist;
|
2015-01-10 11:04:26 +00:00
|
|
|
|
|
|
|
done(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2015-07-15 15:22:19 +00:00
|
|
|
});
|