diff --git a/test/spec/browser/ModelerSpec.js b/test/spec/browser/ModelerSpec.js index d0f12a7f..f33eea5e 100644 --- a/test/spec/browser/ModelerSpec.js +++ b/test/spec/browser/ModelerSpec.js @@ -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'); diff --git a/test/spec/browser/ViewerSpec.js b/test/spec/browser/ViewerSpec.js index 9aef9d89..f97f73b4 100644 --- a/test/spec/browser/ViewerSpec.js +++ b/test/spec/browser/ViewerSpec.js @@ -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) { diff --git a/test/spec/browser/import/ImporterSpec.js b/test/spec/browser/import/ImporterSpec.js index 132385a2..ffa32413 100644 --- a/test/spec/browser/import/ImporterSpec.js +++ b/test/spec/browser/import/ImporterSpec.js @@ -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 during import', function(done) { // given var xml = fs.readFileSync('test/fixtures/bpmn/simple.bpmn', 'utf8');