'use strict'; var Matchers = require('../../../Matchers'), TestHelper = require('../../../TestHelper'); /* global bootstrapBpmnJS, inject */ var fs = require('fs'); var $ = require('jquery'); var labelEditingModule = require('../../../../../lib/features/label-editing'), bpmnModule = require('../../../../../lib/draw'); var LabelUtil = require('../../../../../lib/features/label-editing/LabelUtil'); describe('features - label-editing', function() { beforeEach(Matchers.addDeepEquals); var diagramXML = fs.readFileSync('test/fixtures/bpmn/features/label-editing/labels.bpmn', 'utf-8'); var testModules = [ labelEditingModule, bpmnModule ]; beforeEach(bootstrapBpmnJS(diagramXML, { modules: testModules })); describe('basics', function() { it('should register on dblclick', inject(function(elementRegistry, directEditing, eventBus) { // given var shape = elementRegistry.getById('task-nested-embedded'); // when eventBus.fire('shape.dblclick', { element: shape }); // then expect(directEditing.isActive()).toBe(true); })); it('should cancel on ', inject(function(elementRegistry, directEditing, eventBus) { // given var shape = elementRegistry.getById('task-nested-embedded'), task = shape.businessObject; var oldName = task.name; // activate eventBus.fire('shape.dblclick', { element: shape }); // a jQuery