Skip to content

Commit

Permalink
test: fix flaky test in definition properties
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Oct 16, 2024
1 parent cb8ef20 commit 7ed847e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/dmn-js-drd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"tiny-svg": "^3.1.2"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",
"dmn-font": "^0.6.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
query as domQuery
} from 'min-dom';

import { waitFor } from '@testing-library/dom';

import { getBusinessObject } from 'dmn-js-shared/lib/util/ModelUtil';

import {
Expand Down Expand Up @@ -309,8 +311,8 @@ describe('features/definition-properties', function() {
));


skipFF()('should clear error message on blur', inject(
function(definitionPropertiesEdit, definitionPropertiesView) {
it('should clear error message on blur', inject(
async function(definitionPropertiesEdit, definitionPropertiesView) {

// given
var idContainer = domQuery(
Expand All @@ -326,13 +328,15 @@ describe('features/definition-properties', function() {
idContainer.blur();

// then
var errorMessage = domQuery(
'.dmn-definitions-error-message',
definitionPropertiesView._container
);

expect(errorMessage).not.to.exist;
expect(domClasses(idContainer).has('dmn-definitions-error')).to.be.false;
await waitFor(() => {
var errorMessage = domQuery(
'.dmn-definitions-error-message',
definitionPropertiesView._container
);

expect(errorMessage).not.to.exist;
expect(domClasses(idContainer).has('dmn-definitions-error')).to.be.false;
});
}
));

Expand All @@ -341,13 +345,3 @@ describe('features/definition-properties', function() {
});

});

// helpers //////////////////

function isFirefox() {
return /Firefox/.test(window.navigator.userAgent);
}

function skipFF() {
return isFirefox() ? it.only : it;
}

0 comments on commit 7ed847e

Please sign in to comment.