chore: vault tests refactors and lint (#2374)

This commit is contained in:
Karol Sójko
2023-08-02 00:23:56 +02:00
committed by GitHub
parent a0bc1d2488
commit 247daddf5a
96 changed files with 1463 additions and 751 deletions

View File

@@ -58,16 +58,15 @@ describe('preferences', function () {
})
it('emits an event when preferences change', async function () {
let callTimes = 0
this.application.addEventObserver(() => {
callTimes++
}, ApplicationEvent.PreferencesChanged)
callTimes += 1
await Factory.sleep(0) /** Await next tick */
expect(callTimes).to.equal(1) /** App start */
await register.call(this)
const promise = new Promise((resolve) => {
this.application.addEventObserver(() => {
resolve()
}, ApplicationEvent.PreferencesChanged)
})
await this.application.setPreference('editorLeft', 300)
expect(callTimes).to.equal(2)
await promise
expect(promise).to.be.fulfilled
})
it('discards existing preferences when signing in', async function () {