Selecting a value from a dropdown list of options.

Usage

import { PlumaTestHelpers } from '@customerio/pluma-components/react/test-helpers/pluma-test-helpers'

const select = PlumaTestHelpers.extract('Select', document.querySelector('[data-test-pluma-id="PlumaSelect"]'));

Test Helpers

Clears the search input (for searchable selects)

Closes the dropdown

Deselects an option by its text (for multi-select)

Gets detailed information about all available options

Gets detailed information about a specific option by its label text

Gets detailed information about a specific option by its value

Gets the error message if present

Checks if the select is disabled

Checks if the select is in an invalid state

Checks if the select is in loading state

Checks if the dropdown is open

Gets the label text of the select

Gets the name attribute of the hidden input (for form submission)

Gets array of available option labels

Gets the placeholder text when no selection is made

Gets the current search input value (if searchable)

Gets the currently selected label text (for single select)

Gets the currently selected labels (for multi-select)

Gets the currently selected value (for single select)

Gets the currently selected values (for multi-select)

Checks if the select has a specific error message

Checks if a specific option is selected

Searches for an option and selects it if it exists, or clicks the "Create" option to create it.

Searches for options and selects the best matching result. Priority: exact match > case-sensitive starts-with > case-insensitive starts-with > substring > first option.

Selects an option by its label text

Types a value into the search input and selects the option with that exact value. Useful for virtualized lists where options must be searched to appear in the DOM.

On this page