Skip to content

Commit

Permalink
Fix one test
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Feb 14, 2025
1 parent d52507b commit 919e894
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ if (typeof window.toolbarButtonsCount !== 'number') {
*
* @param {number} timeout
* @return {*}
* @deprecated Use mockTimers instead and mockTimers().delay
*/
function delay(timeout) {
return new naturalPromise(resolve => {
Expand Down
4 changes: 4 additions & 0 deletions test/tests/acceptance/editor-ready.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,18 +277,22 @@ describe('Readiness', () => {

describe('Async init', () => {
it('Should return resolved promise', done => {
const timers = mockTimers();
unmockPromise();

const jodit = getJodit({
events: {
createEditor: () => delay(100)
}
});

expect(jodit.isReady).is.false;
timers.delay(700);

jodit.waitForReady().then(j => {
expect(jodit).eq(j);
expect(jodit.isReady).is.true;
timers.cleanup();
done();
});
});
Expand Down

0 comments on commit 919e894

Please sign in to comment.