fix(specs) Fix spellchecker tests

This commit is contained in:
Juan Tejada 2017-02-09 16:34:53 -08:00
parent eb5aa235a8
commit 61543a0c6e
2 changed files with 10 additions and 1 deletions

View file

@ -15,6 +15,11 @@ describe('SpellcheckComposerExtension', function spellcheckComposerExtension() {
const lookupPath = path.join(__dirname, 'fixtures', 'california-spelling-lookup.json');
const spellings = JSON.parse(fs.readFileSync(lookupPath));
spyOn(Spellchecker, 'isMisspelled').andCallFake(word => spellings[word])
spyOn(Spellchecker.handler, 'provideHintText').andReturn({
then(cb) {
cb()
},
})
});
describe("onContentChanged", () => {
@ -28,6 +33,8 @@ describe('SpellcheckComposerExtension', function spellcheckComposerExtension() {
};
SpellcheckComposerExtension.onContentChanged({editor});
advanceClock(1000) // Wait for debounce
advanceClock(1) // Wait for defer
expect(node.innerHTML).toEqual(afterHTML);
});
@ -51,6 +58,8 @@ describe('SpellcheckComposerExtension', function spellcheckComposerExtension() {
};
SpellcheckComposerExtension.onContentChanged({editor});
advanceClock(1000) // Wait for debounce
advanceClock(1) // Wait for defer
expect(node.innerHTML).toEqual(`
<br>
This is a <spelling class="misspelled">testst</spelling>! I have a few <spelling class="misspelled">misspellled</spelling> words.

2
src/K2

@ -1 +1 @@
Subproject commit 3390bc0783d7f17906a6884e4d757876a337506f
Subproject commit 590a4499fea6bece4ef5da40ca8f1b4d74ba72f5