update repo structure

This commit is contained in:
Rene Haas
2022-07-30 19:45:11 +02:00
parent 908f692569
commit 843d627715
158 changed files with 26998 additions and 9790 deletions
+30
View File
@@ -0,0 +1,30 @@
import { waitFor } from '@testing-library/dom';
const getTestResultElm = () => document.getElementById('testResult');
export const setTestResult = (result) => {
const elm = getTestResultElm();
if (elm) {
if (typeof result === 'boolean') {
if (result) {
if (elm.getAttribute('class') === 'failed') {
return;
}
}
elm.setAttribute('class', result ? 'passed' : 'failed');
}
else {
elm.removeAttribute('class');
}
}
};
export const testPassed = () => {
const elm = getTestResultElm();
return elm ? elm.getAttribute('class') === 'passed' : false;
};
export const waitForOrFailTest = (callback, options) => waitFor(callback, {
...options,
onTimeout(error) {
setTestResult(false);
return error;
},
});
//# sourceMappingURL=TestResult.js.map