Skip to content

Commit

Permalink
Simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
artemave committed Oct 9, 2020
1 parent d60163d commit 9e9c82f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.DS_Store
/dist/
docs-dist/
.exrc
14 changes: 3 additions & 11 deletions test/enterTextSpec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import {expect} from 'chai'
import {DomAssembly} from './assemblies/DomAssembly'
import retry from '../lib/retry'

async function wait(ms): Promise<void> {
return new Promise((resolve, reject) => {
setTimeout(resolve, ms)
})
}

describe('enterText', function () {
let assembly
Expand Down Expand Up @@ -36,9 +29,7 @@ describe('enterText', function () {
})

await browser.enterText('.element', ['the text', '{Enter}'])
await retry(() => {
expect(formSubmitted).to.eq(true)
})
expect(formSubmitted).to.eq(true)
})

it('does not submit form on {Enter} if input catches and cancells the "keypress" event', async function() {
Expand All @@ -58,8 +49,9 @@ describe('enterText', function () {
})

await browser.enterText('.element', ['the text', '{Enter}'])
await wait(100)

expect(formSubmitted).to.eq(false)
})

// TODO what if they really want to type {Enter}?
})

0 comments on commit 9e9c82f

Please sign in to comment.