test(browser): clean up unused code + keep rendered resources

This commit is contained in:
Nico Rehwaldt 2014-04-25 13:30:10 +02:00
parent 0878841b0f
commit 7d0e8dabe0
3 changed files with 10 additions and 38 deletions

View File

@ -1,33 +1,21 @@
var fs = require('fs');
var BpmnModel = require('bpmn-moddle'),
Modeler = require('../../../lib/Modeler');
var Modeler = require('../../../lib/Modeler');
var Matchers = require('../Matchers');
describe('Modeler', function() {
var bpmnModel = BpmnModel.instance();
function read(xml, opts, callback) {
return BpmnModel.fromXML(xml, 'bpmn:Definitions', opts, callback);
}
beforeEach(Matchers.add);
var container;
beforeEach(Matchers.add);
beforeEach(function() {
container = document.createElement('div');
document.getElementsByTagName('body')[0].appendChild(container);
});
afterEach(function() {
container.parentNode.removeChild(container);
});
it('should import simple process', function(done) {
@ -39,8 +27,8 @@ describe('Modeler', function() {
done(err);
});
});
it('should import empty definitions', function(done) {
var xml = fs.readFileSync('test/fixtures/bpmn/empty-definitions.bpmn', 'utf8');

View File

@ -1,33 +1,21 @@
var fs = require('fs');
var BpmnModel = require('bpmn-moddle'),
Viewer = require('../../../lib/Viewer');
var Viewer = require('../../../lib/Viewer');
var Matchers = require('../Matchers');
describe('Viewer', function() {
var bpmnModel = BpmnModel.instance();
function read(xml, opts, callback) {
return BpmnModel.fromXML(xml, 'bpmn:Definitions', opts, callback);
}
beforeEach(Matchers.add);
var container;
beforeEach(Matchers.add);
beforeEach(function() {
container = document.createElement('div');
document.getElementsByTagName('body')[0].appendChild(container);
});
afterEach(function() {
container.parentNode.removeChild(container);
});
it('should import simple process', function(done) {

View File

@ -29,20 +29,16 @@ describe('import/Importer', function() {
document.getElementsByTagName('body')[0].appendChild(container);
});
afterEach(function() {
container.parentNode.removeChild(container);
});
function createDiagram() {
return new Diagram({
canvas: { container: container },
modules: [ bpmnModule ],
components: [ 'bpmnRegistry']
components: [ 'bpmnRegistry' ]
});
}
it('should fire bpmn.element.add during import', function(done) {
it('should fire <bpmn.element.add> during import', function(done) {
// given
var xml = fs.readFileSync('test/fixtures/bpmn/simple.bpmn', 'utf8');