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:
Ashley Harrison
2024-05-28 14:51:47 +01:00
committed by GitHub
parent 6205236f25
commit b4e49e3114
21 changed files with 60 additions and 45 deletions

View File

@ -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);