2018-04-02 19:01:53 +00:00
|
|
|
import NavigatedViewer from 'lib/NavigatedViewer';
|
2015-01-10 11:04:26 +00:00
|
|
|
|
2018-05-23 12:27:32 +00:00
|
|
|
import TestContainer from 'mocha-test-container-support';
|
2015-01-10 11:04:26 +00:00
|
|
|
|
|
|
|
describe('NavigatedViewer', function() {
|
|
|
|
|
|
|
|
var container;
|
|
|
|
|
|
|
|
beforeEach(function() {
|
2018-05-23 12:27:32 +00:00
|
|
|
container = TestContainer.get(this);
|
2015-01-10 11:04:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function createViewer(xml, done) {
|
2018-05-23 12:27:32 +00:00
|
|
|
var viewer = new NavigatedViewer({
|
|
|
|
container: container
|
|
|
|
});
|
2015-01-10 11:04:26 +00:00
|
|
|
|
|
|
|
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
|
|
|
});
|