Skip to content

Commit

Permalink
Check for clear button to be present after blur
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonlenz committed May 6, 2021
1 parent 71e8d80 commit 7812a6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/forms/ComboBox/ComboBox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1014,14 +1014,16 @@ describe('ComboBox component', () => {
)

const input = getByTestId('combo-box-input')
const clearButton = getByTestId('combo-box-clear-button')
userEvent.type(input, '{backspace}')

expect(getByTestId('combo-box-clear-button')).not.toBeVisible()
expect(clearButton).not.toBeVisible()
expect(getByTestId('combo-box-option-list').children.length).toEqual(1)

fireEvent.blur(input)

expect(input).toHaveValue('Avocado')
expect(clearButton).toBeVisible()
})

it('does not hijack focus while tabbing when another field has focus', () => {
Expand Down

0 comments on commit 7812a6d

Please sign in to comment.