Skip to content

Commit

Permalink
Dismiss open autocompletes between tests
Browse files Browse the repository at this point in the history
Clearing the value doesn’t seem to work reliably when the autocomplete is currently open, especially if it has been interacted with (e.g. in a test that sends the arrow down key to focus on a result)

By sending ‘escape’ we dismiss any open autocompletes, which then seems to make the input-clearing work reliably.
  • Loading branch information
36degrees committed Jan 2, 2020
1 parent fe3ea11 commit 4380a8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/integration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ const basicExample = () => {
const secondOption = `${menu} > li:nth-child(2)`

beforeEach(() => {
browser.setValue(input, '') // Prevent autofilling, IE likes to do this.
// Dismiss any open autocompletes
browser.addValue(input, ['Escape'])

// Prevent autofilling, IE likes to do this.
browser.setValue(input, '')
})

it('should show the input', () => {
Expand Down

0 comments on commit 4380a8d

Please sign in to comment.