Skip to content

Commit

Permalink
test: fix async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jarekdanielak committed Dec 18, 2024
1 parent 5873297 commit f151698
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 3 additions & 2 deletions test/spec/DmnPropertiesPanelRenderer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,11 @@ describe('<DmnPropertiesPanelRenderer>', function() {
describe('header name', function() {

beforeEach(async function() {
await createModeler(diagramXml);
await act(async () => {
await createModeler(diagramXml);
});
});


it('should keep state during detach and attach', inject(async function(elementRegistry, selection, propertiesPanel) {

// given
Expand Down
11 changes: 7 additions & 4 deletions test/spec/provider/camunda/IdProps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ describe('provider/dmn - IdProps', function() {
it('should set invalid', inject(async function(elementRegistry, selection) {

// given
const task = elementRegistry.get('Task_1');
const shape = elementRegistry.get('Decision_1');

await act(() => {
selection.select(task);
selection.select(shape);
});

// when
Expand All @@ -129,7 +129,7 @@ describe('provider/dmn - IdProps', function() {
});

// then
const error = domQuery('.bio-properties-panel-input-error', container);
const error = domQuery('.bio-properties-panel-error', container);
expect(error).to.exist;
}));

Expand All @@ -143,8 +143,11 @@ describe('provider/dmn - IdProps', function() {
selection.select(shape);
});

// when
// expect
const idInput = domQuery('input[name=id]', container);
expect(idInput.value).to.exist;

// when
changeInput(idInput, '');

// then
Expand Down
11 changes: 7 additions & 4 deletions test/spec/provider/dmn/IdProps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,23 @@ describe('provider/dmn - IdProps', function() {
it('should set invalid', inject(async function(elementRegistry, selection) {

// given
const task = elementRegistry.get('Task_1');
const shape = elementRegistry.get('Decision_1');

await act(() => {
selection.select(task);
selection.select(shape);
});

// when
// expect
const idInput = domQuery('input[name=id]', container);
expect(idInput.value).to.exist;

// when
await act(() => {
changeInput(idInput, '');
});

// then
const error = domQuery('.bio-properties-panel-input-error', container);
const error = domQuery('.bio-properties-panel-error', container);
expect(error).to.exist;
}));

Expand Down

0 comments on commit f151698

Please sign in to comment.