bpmn-js/test/spec/environment/MockingSpec.js
Nico Rehwaldt 9be61259bd chore(project): drop 'use strict'
We use ES modules, so 'use strict' is not necessary anymore.
2018-04-03 18:09:53 +02:00

53 lines
932 B
JavaScript

import {
bootstrapViewer,
inject
} from 'test/TestHelper';
import Events from 'diagram-js/lib/core/EventBus';
import Viewer from 'lib/Viewer';
describe('environment - mocking', function() {
var diagramXML = require('../../fixtures/bpmn/simple.bpmn');
var mockEvents, bootstrapCalled;
beforeEach(bootstrapViewer(diagramXML, {
modules: Viewer.prototype._modules
}, function() {
mockEvents = new Events();
bootstrapCalled = true;
return {
eventBus: mockEvents
};
}));
afterEach(function() {
bootstrapCalled = false;
});
it('should use spy', inject(function(eventBus) {
expect(eventBus).to.eql(mockEvents);
expect(bootstrapCalled).to.be.true;
}));
it('should reparse bootstrap code', inject(function(eventBus) {
expect(bootstrapCalled).to.be.true;
}));
it('should inject bpmnjs', inject(function(bpmnjs) {
expect(bpmnjs).to.exist;
}));
});