Compare commits
3 Commits
develop
...
list-test-
Author | SHA1 | Date |
---|---|---|
John McLear | c8c78987d8 | |
John McLear | d1c66123dd | |
John McLear | 58604a0824 |
|
@ -32,13 +32,22 @@ describe('ordered_list.js', function () {
|
||||||
.done(done);
|
.done(done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
context('and pad shortcut is disabled', function () {
|
context('and pad shortcut is disabled', function () {
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
const originalHTML = helper.padInner$('body').html();
|
const originalHTML = helper.padInner$('body').html();
|
||||||
makeSureShortcutIsDisabled('cmdShiftN');
|
makeSureShortcutIsDisabled('cmdShiftN');
|
||||||
triggerCtrlShiftShortcut('N');
|
triggerCtrlShiftShortcut('N');
|
||||||
await helper.waitForPromise(() => helper.padInner$('body').html() !== originalHTML);
|
try {
|
||||||
|
// The HTML should not change. Briefly wait for it to change and fail if it does change.
|
||||||
|
await helper.waitForPromise(
|
||||||
|
() => helper.padInner$('body').html() !== originalHTML, 500);
|
||||||
|
} catch (err) {
|
||||||
|
// We want the test to pass if the above wait timed out. (If it timed out that
|
||||||
|
// means the HTML never changed, which is a good thing.)
|
||||||
|
// 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);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not insert unordered list', function (done) {
|
it('does not insert unordered list', function (done) {
|
||||||
|
@ -73,7 +82,17 @@ describe('ordered_list.js', function () {
|
||||||
const originalHTML = helper.padInner$('body').html();
|
const originalHTML = helper.padInner$('body').html();
|
||||||
makeSureShortcutIsDisabled('cmdShift1');
|
makeSureShortcutIsDisabled('cmdShift1');
|
||||||
triggerCtrlShiftShortcut('1');
|
triggerCtrlShiftShortcut('1');
|
||||||
await helper.waitForPromise(() => helper.padInner$('body').html() !== originalHTML);
|
try {
|
||||||
|
// The HTML should not change. Briefly wait for it to change and fail if it does change.
|
||||||
|
await helper.waitForPromise(
|
||||||
|
() => helper.padInner$('body').html() !== originalHTML, 500);
|
||||||
|
} catch (err) {
|
||||||
|
// We want the test to pass if the above wait timed out. (If it timed out that
|
||||||
|
// means the HTML never changed, which is a good thing.)
|
||||||
|
// 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);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not insert unordered list', function (done) {
|
it('does not insert unordered list', function (done) {
|
||||||
|
|
Loading…
Reference in New Issue