Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/features/label-editing/LabelEditingProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ export default function LabelEditingProvider(

function activateDirectEdit(element, force) {
if (force ||
isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation', 'bpmn:Participant' ]) ||
isCollapsedSubProcess(element)) {
isAny(element, [ 'bpmn:Activity', 'bpmn:Event', 'bpmn:TextAnnotation', 'bpmn:Participant' ])) {

directEditing.activate(element);
}
Expand Down
119 changes: 117 additions & 2 deletions test/spec/features/label-editing/LabelEditingProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ describe('features - label-editing', function() {

describe('on element creation', function() {

function createTaskElement(context) {
var shape = elementFactory.create('shape', { type: 'bpmn:Task' }),
function createElement(type, context) {
var shape = elementFactory.create('shape', { type: type }),
parent = elementRegistry.get('SubProcess_1'),
parentGfx = elementRegistry.getGraphics(parent);

Expand All @@ -587,6 +587,10 @@ describe('features - label-editing', function() {
dragging.end();
}

function createTaskElement(context) {
createElement('bpmn:Task', context);
}

function createParticipant() {

var collaboration = elementRegistry.get('Collaboration_1o0amh9'),
Expand Down Expand Up @@ -625,6 +629,117 @@ describe('features - label-editing', function() {
expect(directEditing.isActive()).to.be.true;
});


it('on StartEvent creation', function() {

// when
createElement('bpmn:StartEvent');

// then
expect(directEditing.isActive()).to.be.true;
});


it('on EndEvent creation', function() {

// when
createElement('bpmn:EndEvent');

// then
expect(directEditing.isActive()).to.be.true;
});


it('on IntermediateThrowEvent creation', function() {

// when
createElement('bpmn:IntermediateThrowEvent');

// then
expect(directEditing.isActive()).to.be.true;
});


it('on CallActivity creation', function() {

// when
createElement('bpmn:CallActivity');

// then
expect(directEditing.isActive()).to.be.true;
});

it('on subProcess creation', function() {
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test description uses inconsistent capitalization: "subProcess" should match the BPMN type name ("SubProcess") like the other test cases (e.g., "StartEvent", "EndEvent"). This improves readability and keeps test names consistent.

Suggested change
it('on subProcess creation', function() {
it('on SubProcess creation', function() {

Copilot uses AI. Check for mistakes.

// when
createElement('bpmn:SubProcess');

// then
expect(directEditing.isActive()).to.be.true;
});

it('on adHocSubProcess creation', function() {
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test description uses inconsistent capitalization: "adHocSubProcess" should match the BPMN type name ("AdHocSubProcess") like the other test cases. Keeping test titles consistent makes failures easier to scan.

Suggested change
it('on adHocSubProcess creation', function() {
it('on AdHocSubProcess creation', function() {

Copilot uses AI. Check for mistakes.

// when
createElement('bpmn:AdHocSubProcess');

// then
expect(directEditing.isActive()).to.be.true;
});

});

describe('should NOT activate', function() {

it('on ExclusiveGateway creation', function() {

// when
createElement('bpmn:ExclusiveGateway');

// then
expect(directEditing.isActive()).to.be.false;
});


it('on ParallelGateway creation', function() {

// when
createElement('bpmn:ParallelGateway');

// then
expect(directEditing.isActive()).to.be.false;
});


it('on InclusiveGateway creation', function() {

// when
createElement('bpmn:InclusiveGateway');

// then
expect(directEditing.isActive()).to.be.false;
});


it('on ComplexGateway creation', function() {

// when
createElement('bpmn:ComplexGateway');

// then
expect(directEditing.isActive()).to.be.false;
});


it('on EventBasedGateway creation', function() {

// when
createElement('bpmn:EventBasedGateway');

// then
expect(directEditing.isActive()).to.be.false;
});

});


Expand Down
Loading