Removed event handlers after JavaScript tests complete.

Fixes error "Assertion occurred after test had finished" with newer
versions of QUnit.
This commit is contained in:
Jon Dufresne 2020-03-14 15:08:03 -07:00 committed by Carlton Gibson
parent 25d450c852
commit 48d50dd53f
1 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,7 @@ QUnit.test('add/remove form events', function(assert) {
assert.ok(true, 'event `formset:added` triggered');
assert.equal(true, $row.is('#first-1'));
assert.equal(formsetName, 'first');
$document.off('formset:added');
});
addButton.click();
var deletedRow = $('#first-1');
@ -55,6 +56,7 @@ QUnit.test('add/remove form events', function(assert) {
assert.ok(true, 'event `formset:removed` triggered');
assert.equal(true, $row.is(deletedRow));
assert.equal(formsetName, 'first');
$document.off('formset:removed');
});
deleteLink.trigger($.Event('click', {target: deleteLink}));
});