mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-03 03:23:45 +08:00
fix(specs) Fix spellchecker tests
This commit is contained in:
parent
eb5aa235a8
commit
61543a0c6e
2 changed files with 10 additions and 1 deletions
|
@ -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
2
src/K2
|
@ -1 +1 @@
|
|||
Subproject commit 3390bc0783d7f17906a6884e4d757876a337506f
|
||||
Subproject commit 590a4499fea6bece4ef5da40ca8f1b4d74ba72f5
|
Loading…
Reference in a new issue