forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [Search:Search Applications page]Popover for Create button is in…
…accessible via keyboard (elastic#201193) Closes: elastic#199760 Popovers, dialogs which are accessible with mouse, should also be accessible with keyboard. Otherwise users using only keyboard will miss the information present in popover, dialog. Closes: elastic#199749 User reaches the same button two times when navigating using only keyboard and it can get confusing. Better for element to get focus only one time when navigating in sequence from one element to another and for the user only to hear one announcement of the element. ## What was changed: 1. `CreateSearchApplicationButton` component: - `EuiPopover` was replaced to more a11y-friendly `EuiToolTip` - extra `div` element with `tabindex` was removed. ## Screen https://github.com/user-attachments/assets/fbb62841-6f2f-45d0-bee3-39a11a4fc777
- Loading branch information
Showing
3 changed files
with
74 additions
and
126 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...ns/applications/components/search_applications/search_applications_create_button.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { type ReactNode } from 'react'; | ||
|
||
import { render, screen } from '@testing-library/react'; | ||
import userEvent from '@testing-library/user-event'; | ||
|
||
import { waitForEuiToolTipVisible } from '@elastic/eui/lib/test/rtl'; | ||
|
||
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; | ||
|
||
import { CreateSearchApplicationButton } from './search_applications_list'; | ||
|
||
function Container({ children }: { children?: ReactNode }) { | ||
return <IntlProvider locale="en">{children}</IntlProvider>; | ||
} | ||
|
||
describe('CreateSearchApplicationButton', () => { | ||
test('disabled={false}', async () => { | ||
render( | ||
<Container> | ||
<CreateSearchApplicationButton disabled={false} /> | ||
</Container> | ||
); | ||
|
||
await userEvent.hover( | ||
await screen.findByTestId('enterprise-search-search-applications-creation-button') | ||
); | ||
|
||
await waitForEuiToolTipVisible(); | ||
|
||
expect( | ||
await screen.findByTestId('create-search-application-button-popover-content') | ||
).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters