From e9bb2c410ec95207e4461d0862e3afdba6aa6113 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 8 Feb 2021 13:18:19 -0500 Subject: [PATCH] tests: Fix erroneous use of `waitForPromise()` in `ordered_list.js` `waitForPromise()` should always be used with `await` (either directly or with a later `await` on the returned Promise). In this case, the condition should be immediately true so `waitForPromise()` is not the right tool here. --- src/tests/frontend/specs/ordered_list.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tests/frontend/specs/ordered_list.js b/src/tests/frontend/specs/ordered_list.js index af922cb72..6f6b28144 100644 --- a/src/tests/frontend/specs/ordered_list.js +++ b/src/tests/frontend/specs/ordered_list.js @@ -32,6 +32,7 @@ describe('ordered_list.js', function () { .done(done); }); }); + context('and pad shortcut is disabled', function () { beforeEach(async function () { const originalHTML = helper.padInner$('body').html(); @@ -47,7 +48,7 @@ describe('ordered_list.js', function () { // TODO: Re-throw non-"condition never became true" errors to avoid false positives. } // This will fail if the above `waitForPromise()` succeeded. - helper.waitForPromise(() => helper.padInner$('body').html() === originalHTML); + expect(() => helper.padInner$('body').html()).to.be(originalHTML); }); it('does not insert unordered list', function (done) { @@ -92,7 +93,7 @@ describe('ordered_list.js', function () { // TODO: Re-throw non-"condition never became true" errors to avoid false positives. } // This will fail if the above `waitForPromise()` succeeded. - helper.waitForPromise(() => helper.padInner$('body').html() === originalHTML); + expect(() => helper.padInner$('body').html()).to.be(originalHTML); }); it('does not insert unordered list', function (done) {