fix(spellchecker) Fix spellchecker specs

This commit is contained in:
Juan Tejada 2016-11-17 14:51:24 -08:00
parent 710dc1a4c4
commit 91f74f7482

View file

@ -17,7 +17,7 @@ describe('SpellcheckComposerExtension', function spellcheckComposerExtension() {
spyOn(Spellchecker, 'isMisspelled').andCallFake(word => spellings[word])
});
describe("update", () => {
describe("onContentChanged", () => {
it("correctly walks a DOM tree and surrounds mispelled words", () => {
const node = document.createElement('div');
node.innerHTML = initialHTML;
@ -27,7 +27,7 @@ describe('SpellcheckComposerExtension', function spellcheckComposerExtension() {
whilePreservingSelection: (cb) => cb(),
};
SpellcheckComposerExtension.update(editor);
SpellcheckComposerExtension.onContentChanged({editor});
expect(node.innerHTML).toEqual(afterHTML);
});
@ -50,7 +50,7 @@ describe('SpellcheckComposerExtension', function spellcheckComposerExtension() {
whilePreservingSelection: (cb) => cb(),
};
SpellcheckComposerExtension.update(editor);
SpellcheckComposerExtension.onContentChanged({editor});
expect(node.innerHTML).toEqual(`
<br>
This is a <spelling class="misspelled">testst</spelling>! I have a few <spelling class="misspelled">misspellled</spelling> words.