Skip to content

Commit bf72e17

Browse files
committed
Revert dimension_editor.test.tsx test changes
1 parent fb7c422 commit bf72e17

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

x-pack/platform/plugins/shared/lens/public/visualizations/metric/dimension_editor.test.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,20 @@ describe('dimension editor', () => {
195195
};
196196
const clearIcon = async () => {
197197
const iconInput = within(iconSelect).getByTestId('comboBoxSearchInput');
198-
await userEvent.click(iconInput);
198+
// Type 'None' to filter the options list to the "None" option
199199
fireEvent.input(iconInput, { target: { value: 'None' } });
200+
// Wait for the options list popover to appear
200201
const optionsList = await screen.findByTestId(
201202
'comboBoxOptionsList lns-icon-select-optionsList'
202203
);
203-
const noneOption = within(optionsList).getByRole('option', { name: 'None' });
204-
const popoverPanel = optionsList.closest('[id$="_panelId"]');
205-
if (popoverPanel) {
206-
await waitFor(() => {
207-
expect(window.getComputedStyle(popoverPanel).pointerEvents).not.toBe('none');
208-
});
204+
// Find the "None" option in the options list
205+
const noneOption = within(optionsList).getByText('None', { exact: true });
206+
// Click the "None" option to clear the icon selection
207+
if (noneOption) {
208+
await userEvent.click(noneOption);
209+
} else {
210+
throw new Error(`none option not found`);
209211
}
210-
await userEvent.click(noneOption);
211212
};
212213

213214
return {

0 commit comments

Comments
 (0)