Skip to content

Commit

Permalink
Ensure editor instances in tests are properly torn down
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Jun 23, 2016
1 parent 9e41d7c commit 90a1f5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/unit/editor/editor-events-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ test('postDidChange callback fired when card payload changes', (assert) => {
return $('<div id="my-simple-card">simple-card (edit)</div>')[0];
}
}];
editor = Helpers.mobiledoc.renderInto(editorElement, ({post, cardSection}) => {
let editor = Helpers.mobiledoc.renderInto(editorElement, ({post, cardSection}) => {
return post([cardSection('simple-card')]);
}, { cards });

Expand All @@ -205,6 +205,8 @@ test('postDidChange callback fired when card payload changes', (assert) => {
postDidChange = 0;
env.remove();
assert.equal(postDidChange, 1, 'postDidChange called after remove');

editor.destroy();
});

test('inputModeDidChange callback fired when markup is toggled and there is a selection', (assert) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/editor/editor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ test('editor parses HTML post using parser plugins', (assert) => {
seenTagNames.push(element.tagName);
};
let html = '<p><textarea></textarea><img></p>';
let editor = new Editor({html, parserPlugins: [parserPlugin]});
editor = new Editor({html, parserPlugins: [parserPlugin]});
assert.ok(!!editor.post, 'editor loads post');

assert.deepEqual(seenTagNames, ['TEXTAREA', 'IMG']);
Expand Down

0 comments on commit 90a1f5e

Please sign in to comment.