Skip to content

Commit

Permalink
Increase wait time for page updates.
Browse files Browse the repository at this point in the history
The Elm interop works entirely async, so that is adding race conditions
when asserting on page contents.
  • Loading branch information
herbert-pivotal committed Jul 11, 2017
1 parent df04ebd commit e126f0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webSpecs/src/webSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function webSpecs(createDOMFixture, mountApp, teardown = () => {}) {
})
})

it("sends the text inputs for p1 and p2 throws to the play function", function () {
expect(playSpy.calls.mostRecent().args).toContain(p1Throw, p2Throw)
it("sends the text inputs for p1 and p2 throws to the play function", function (done) {
whenPageUpdates(() => expect(playSpy.calls.mostRecent().args).toContain(p1Throw, p2Throw), done)
})
})

Expand Down Expand Up @@ -162,7 +162,7 @@ function webSpecs(createDOMFixture, mountApp, teardown = () => {}) {
}

function whenPageUpdates(assertion, done) {
setTimeout(() => { assertion(); done() }, 0)
setTimeout(() => { assertion(); done() }, 20)
}

beforeEach(function () {
Expand Down

0 comments on commit e126f0b

Please sign in to comment.