File tree Expand file tree Collapse file tree
x-pack/platform/plugins/shared/lens/public/visualizations/metric Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments