From 48d50dd53ffc72983bfe4864f9b20534f55a4dc1 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 14 Mar 2020 15:08:03 -0700 Subject: [PATCH] Removed event handlers after JavaScript tests complete. Fixes error "Assertion occurred after test had finished" with newer versions of QUnit. --- js_tests/admin/inlines.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js_tests/admin/inlines.test.js b/js_tests/admin/inlines.test.js index e450584c626..62a4281190b 100644 --- a/js_tests/admin/inlines.test.js +++ b/js_tests/admin/inlines.test.js @@ -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})); });