mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 02:15:54 +08:00
Select: Ensure screenreader correctly narrates options (#88118)
* replace select aria-label with data-testid * update in copy pasted places as well * update plugin-e2e to 1.2.2
This commit is contained in:
@ -2,6 +2,8 @@ import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
import { QueryEditor, Props } from './QueryEditor';
|
||||
import { scenarios } from './__mocks__/scenarios';
|
||||
import { defaultQuery } from './constants';
|
||||
@ -42,7 +44,7 @@ describe('Test Datasource Query Editor', () => {
|
||||
|
||||
let select = (await screen.findByText('Scenario')).nextSibling!.firstChild!;
|
||||
await fireEvent.keyDown(select, { keyCode: 40 });
|
||||
const scs = screen.getAllByLabelText('Select option');
|
||||
const scs = screen.getAllByTestId(selectors.components.Select.option);
|
||||
|
||||
expect(scs).toHaveLength(scenarios.length);
|
||||
|
||||
|
Reference in New Issue
Block a user