Skip to content

Commit

Permalink
Merge branch 'main' into snyk-upgrade-de353905732d58fe633fb009a3665e48
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Oct 5, 2023
2 parents bf25125 + c77af6e commit 052a31c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ exports[`EuiComboBox renders the options list dropdown 1`] = `
style="inline-size: 2px;"
value=""
/>
<span
aria-live="polite"
class="emotion-euiScreenReaderOnly"
id="generated-id_removeOptionMessage"
>
Combo box. Selected. Combo box input. Type some text or, to display a list of choices, press Down Arrow. To exit the list of choices, press Escape.
</span>
</div>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right euiFormControlLayoutIcons--absolute"
Expand Down
29 changes: 18 additions & 11 deletions src/components/combo_box/combo_box.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
import React from 'react';
import { fireEvent } from '@testing-library/react';
import { render, showEuiComboBoxOptions } from '../../test/rtl';
import { shouldRenderCustomStyles } from '../../test/internal';
import {
shouldRenderCustomStyles,
testOnReactVersion,
} from '../../test/internal';
import { requiredProps } from '../../test';

import { keys } from '../../services';
Expand Down Expand Up @@ -70,17 +73,21 @@ describe('EuiComboBox', () => {
render(<EuiComboBox {...requiredProps} options={options} />);
});

it('renders the options list dropdown', async () => {
const { baseElement } = render(
<EuiComboBox
options={options}
data-test-subj="alsoGetsAppliedToOptionsList"
/>
);
await showEuiComboBoxOptions();
// React 16 for some reason doesn't snapshot the screen reader text
testOnReactVersion(['17', '18'])(
'renders the options list dropdown',
async () => {
const { baseElement } = render(
<EuiComboBox
options={options}
data-test-subj="alsoGetsAppliedToOptionsList"
/>
);
await showEuiComboBoxOptions();

expect(baseElement).toMatchSnapshot();
});
expect(baseElement).toMatchSnapshot();
}
);

it('renders selectedOptions as pills', () => {
const { getAllByTestSubject } = render(
Expand Down

0 comments on commit 052a31c

Please sign in to comment.