import React from 'react'; import { act, render, screen, waitForElementToBeRemoved, waitFor, } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import type { ComboboxOption } from '../../Combobox'; import { DropdownMenuSearch } from '../'; import { Button } from '../../Button'; const costCenters = [ { key: '1', label: 'Marketing' }, { key: '2', label: 'Legal' }, { key: '3', label: 'Office' }, ]; const triggerButtonNoOptionLabel = 'Select a cost center'; const searchPlaceholder = 'Type to search a cost center'; const DropdownMenuSearchWrapper = () => { const [options, setOptions] = React.useState(costCenters); const [selectedOption, setSelectedOption] = React.useState<(typeof costCenters)[number]>(); const buttonLabel = selectedOption?.label ?? triggerButtonNoOptionLabel; return ( (