Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MCR-4038] dropdown menu does not open until the user clicks into field #2396

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export const LinkRateSelect = ({

return (
<Select
defaultMenuIsOpen
value={defaultValue}
className={styles.rateMultiSelect}
options={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ describe('RateDetailsv2', () => {
})
})

it('displays dropdown menu if yes is selected', async () => {
it('displays dropdown menu if yes is selected and dropdown is clicked', async () => {
const { user } = renderWithProviders(
<Routes>
<Route
Expand Down Expand Up @@ -687,7 +687,10 @@ describe('RateDetailsv2', () => {
expect(screen.getByRole('combobox')).toBeInTheDocument()
})

// Assert the options menu is open
// Assert the options menu is open when clicked
const dropdown = screen.getByRole('combobox')
expect(dropdown).toBeInTheDocument()
await user.click(dropdown)
const dropdownMenu = screen.getByRole('listbox')
expect(dropdownMenu).toBeInTheDocument()

Expand Down Expand Up @@ -811,7 +814,10 @@ describe('RateDetailsv2', () => {
expect(screen.getByRole('combobox')).toBeInTheDocument()
})

// Assert the options menu is open
// Assert the options menu is open when clicked
const dropdown = screen.getByRole('combobox')
expect(dropdown).toBeInTheDocument()
await user.click(dropdown)
const dropdownMenu = screen.getByRole('listbox')
expect(dropdownMenu).toBeInTheDocument()

Expand Down Expand Up @@ -897,6 +903,9 @@ describe('RateDetailsv2', () => {
await user.click(yesRadioButton)

// Assert that the selected value is removed from the list of options
const dropdown = screen.getByRole('combobox')
expect(dropdown).toBeInTheDocument()
await user.click(dropdown)
const option = screen
.getByRole('listbox')
.querySelector('#react-select-2-option-0')
Expand Down Expand Up @@ -982,6 +991,9 @@ describe('RateDetailsv2', () => {
await user.click(yesRadioButton)

// Checking that the selected value is removed from the list of options
const dropdown = screen.getByRole('combobox')
expect(dropdown).toBeInTheDocument()
await user.click(dropdown)
const option = screen
.getByRole('listbox')
.querySelector('#react-select-2-option-0')
Expand Down
Loading