Skip to content

Commit

Permalink
test: do not test for order that cannot be guaranteed
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Jan 24, 2025
1 parent 4442dff commit aa32656
Showing 1 changed file with 41 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ describe('<RemoveTemplateReplaceProvider>', function() {
elementTemplates.set(templates);
}));


describe('display', function() {

it('should not display remove on plain task', inject(function(elementRegistry) {
it('should not display (task)', inject(function(elementRegistry) {

// given
const task = elementRegistry.get('Task_1');
Expand All @@ -54,71 +55,64 @@ describe('<RemoveTemplateReplaceProvider>', function() {
openPopup(task);

// then
const entries = Object.keys(getEntries());
expect(entries).not.to.include('replace-remove-element-template');
}));

const entries = getEntries();

describe('display options to reset to plain element in correct order', function() {
expect(entries).not.to.have.property('replace-remove-element-template');
}));

it('template service task -> service task', inject(function() {

// given
const element = applyTemplate(
'ServiceTask_1',
'com.camunda.example.MailTask'
);
it('should display (template service task -> service task)', inject(function() {

// when
openPopup(element);
// given
const element = applyTemplate(
'ServiceTask_1',
'com.camunda.example.MailTask'
);

// then
const entries = Object.keys(getEntries());
const entryIndex = entries.indexOf('replace-remove-element-template');
// when
openPopup(element);

// should be displayed on top
expect(entryIndex).to.be.lessThanOrEqual(2);
}));
// then
const entries = getEntries();

expect(entries).to.have.property('replace-remove-element-template');
}));

it('template task -> task', inject(function() {

// given
const element = applyTemplate(
'Task_1',
'example.TaskTemplate'
);
it('should display (template task -> task)', inject(function() {

// when
openPopup(element);
// given
const element = applyTemplate(
'Task_1',
'example.TaskTemplate'
);

// then
const entries = Object.keys(getEntries());
const entryIndex = entries.indexOf('replace-remove-element-template');
// when
openPopup(element);

expect(entryIndex).to.eql(0);
}));
// then
const entries = getEntries();

expect(entries).to.have.property('replace-remove-element-template');
}));

it('template transaction -> transaction', inject(function() {

// given
const element = applyTemplate(
'SUB_PROCESS',
'example.TransactionTemplate'
);
it('should display (template transaction -> transaction)', inject(function() {

// when
openPopup(element);
// given
const element = applyTemplate(
'SUB_PROCESS',
'example.TransactionTemplate'
);

// then
const entries = Object.keys(getEntries());
const entryIndex = entries.indexOf('replace-remove-element-template');
// when
openPopup(element);

expect(entryIndex).to.greaterThanOrEqual(0);
}));
// then
const entries = getEntries();

});
expect(entries).to.have.property('replace-remove-element-template');
}));

});

Expand Down

0 comments on commit aa32656

Please sign in to comment.