mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-11 00:12:26 +03:00
update repo structure
This commit is contained in:
+30
@@ -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
|
||||
Reference in New Issue
Block a user