Skip to content

Commit

Permalink
test: verify loop characteristics not replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Oct 31, 2024
1 parent c41e232 commit bfa184b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions test/spec/features/popup-menu/ReplaceMenuProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,20 +537,21 @@ describe('features/popup-menu - replace menu provider', function() {
// given
var task = elementRegistry.get('SequentialTask'),
businessObject = getBusinessObject(task),
loopCharacteristics = Object.assign({}, businessObject.loopCharacteristics);
loopCharacteristics = businessObject.get('loopCharacteristics');

openPopup(task);

// assume
expect(loopCharacteristics.isSequential).to.be.true;
expect(loopCharacteristics.get('isSequential')).to.be.true;

// when
triggerAction('toggle-parallel-mi');

// then
var newLoopCharacteristics = businessObject.loopCharacteristics;
const newLoopCharacteristics = businessObject.get('loopCharacteristics');

expect(newLoopCharacteristics.isSequential).to.be.false;
expect(newLoopCharacteristics).to.equal(loopCharacteristics);
expect(newLoopCharacteristics.get('isSequential')).to.be.false;
expect(omit(newLoopCharacteristics, 'isSequential')).to.eql(omit(loopCharacteristics, 'isSequential'));
}));

Expand Down Expand Up @@ -662,21 +663,22 @@ describe('features/popup-menu - replace menu provider', function() {
// given
var task = elementRegistry.get('ParallelTask'),
businessObject = getBusinessObject(task),
loopCharacteristics = Object.assign({}, businessObject.loopCharacteristics);
loopCharacteristics = businessObject.get('loopCharacteristics');

openPopup(task);

// assume
expect(loopCharacteristics.isSequential).to.be.undefined;
expect(loopCharacteristics.get('isSequential')).to.be.false;

// when
triggerAction('toggle-sequential-mi');

// then
var newLoopCharacteristics = businessObject.loopCharacteristics;
var newLoopCharacteristics = businessObject.get('loopCharacteristics');

expect(newLoopCharacteristics.isSequential).to.be.true;
expect(omit(newLoopCharacteristics, 'isSequential')).to.eql(loopCharacteristics);
expect(newLoopCharacteristics).to.equal(loopCharacteristics);
expect(newLoopCharacteristics.get('isSequential')).to.be.true;
expect(omit(newLoopCharacteristics, 'isSequential')).to.eql(omit(loopCharacteristics, 'isSequential'));
}));

});
Expand Down

0 comments on commit bfa184b

Please sign in to comment.