UI/Alert: Infer the role property based on the severity (#61242)

* feat(UI/Alert): add two new optional properties: 'ariaLabel' and 'role'

* docs(UI/Alert): add some docs to the props

* feat: infer the role based on the severity

* fix: stop overriding props

* fix: fix a test depending on the wrong alert role
This commit is contained in:
Levente Balogh
2023-01-18 10:16:41 +01:00
committed by GitHub
parent 6c566a391d
commit 29119a7d08
3 changed files with 40 additions and 10 deletions

View File

@@ -69,7 +69,7 @@ describe('QueryEditorField', () => {
it('shows an info alert when no datasource is selected', async () => {
renderWithContext(<QueryEditorField name="query" />);
expect(await screen.findByRole('alert', { name: 'No data source selected' })).toBeInTheDocument();
expect(await screen.findByRole('status', { name: 'No data source selected' })).toBeInTheDocument();
});
it('shows an info alert when datasaource does not export a query editor', async () => {