fix: prevent in-memory sessions from writing to custom spellchecker dictionary (#22157)

* fix: prevent in-memory sessions from writing to custom dictionary

* docs

* spec
This commit is contained in:
Erick Zhao 2020-03-10 00:45:43 -07:00 committed by GitHub
parent c0374b5796
commit 3ff98e15d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 2 deletions

View file

@ -105,6 +105,13 @@ describe('spellchecker', () => {
const wordList = await ses.listWordsInSpellCheckerDictionary
expect(wordList).to.have.length(0)
})
// remove API will always return false because we can't add words
it('should fail for non-persistent sessions', async () => {
const tempSes = session.fromPartition('temporary')
const result = tempSes.addWordToSpellCheckerDictionary('foobar')
expect(result).to.equal(false)
})
})
describe('ses.removeWordFromSpellCheckerDictionary', () => {