'use strict'; var Matchers = require('../Matchers'), TestHelper = require('../TestHelper'); var fs = require('fs'); var Modeler = require('../../lib/Modeler'); describe('modeler', function() { beforeEach(Matchers.addDeepEquals); var container; beforeEach(function() { container = jasmine.getEnv().getTestContainer(); }); function createModeler(xml, done) { var modeler = new Modeler({ container: container }); modeler.importXML(xml, function(err) { done(err, modeler); }); } it('should import simple process', function(done) { var xml = fs.readFileSync('test/fixtures/bpmn/simple.bpmn', 'utf8'); createModeler(xml, done); }); it('should import empty definitions', function(done) { var xml = fs.readFileSync('test/fixtures/bpmn/empty-definitions.bpmn', 'utf8'); createModeler(xml, done); }); describe('overlay support', function() { it('should allow to add overlays', function(done) { var xml = fs.readFileSync('test/fixtures/bpmn/simple.bpmn', 'utf8'); createModeler(xml, function(err, viewer) { // when var overlays = viewer.get('overlays'), elementRegistry = viewer.get('elementRegistry'); // then expect(overlays).toBeDefined(); expect(elementRegistry).toBeDefined(); // given var subProcessShape = elementRegistry.getById('SubProcess_1'); // when overlays.add('SubProcess_1', { position: { bottom: 0, right: 0 }, html: '