Skip to main content


react-select-event is a companion library for React Testing Library that provides helper methods for interacting with react-select elements.

npm install --save-dev react-select-event
import React from 'react'
import Select from 'react-select'
import {render} from '@testing-library/react'
import selectEvent from 'react-select-event'

const {getByTestId, getByLabelText} = render(
<form data-testid="form">
<label htmlFor="food">Food</label>
<Select options={OPTIONS} name="food" inputId="food" isMulti />
expect(getByTestId('form')).toHaveFormValues({food: ''}) // empty select

// select two values...
await'Food'), ['Strawberry', 'Mango'])
expect(getByTestId('form')).toHaveFormValues({food: ['strawberry', 'mango']})

// ...and add a third one
await'Food'), 'Chocolate')
food: ['strawberry', 'mango', 'chocolate'],