Skip to content

Commit

Permalink
correctly await yielding the onConfigChanged callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mann committed Dec 12, 2019
1 parent c52c341 commit ffa2aca
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/desktop-gui/cypress/integration/settings_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,24 @@ describe('Settings', () => {
])({})
}

this.ipc.openProject.onCall(1).resolves(setConfigEnv(this.config, null))
this.ipc.onConfigChanged.yield()

cy.contains('.line', 'env:null')
this.ipc.openProject
.onCall(1).resolves(setConfigEnv(this.config, null))
.onCall(3).resolves(setConfigEnv(this.config, undefined))
.onCall(2).resolves(setConfigEnv(this.config, {}))

this.ipc.openProject.onCall(2).resolves(setConfigEnv(this.config, {}))
this.ipc.onConfigChanged.yield()

cy.contains('.line', 'env:null')
.then(() => {
this.ipc.onConfigChanged.yield()

this.ipc.openProject.onCall(3).resolves(setConfigEnv(this.config, undefined))
this.ipc.onConfigChanged.yield()
cy.contains('.line', 'env:null')
.then(() => {
this.ipc.onConfigChanged.yield()

cy.contains('.line', 'env:null')
cy.contains('.line', 'env:null')
})
})
})

it('displays env settings', () => {
Expand Down

0 comments on commit ffa2aca

Please sign in to comment.