-
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.
feat: add tooltips on preview navigator icon buttons
Refs: PREV-139 (#120)
- Loading branch information
1 parent
b066bdb
commit 5813a0f
Showing
9 changed files
with
153 additions
and
23 deletions.
There are no files selected for viewing
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
13 changes: 13 additions & 0 deletions
13
docs/api/carbonio-ui-preview.previewnavigatorprops.nexttooltip.md
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,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@zextras/carbonio-ui-preview](./carbonio-ui-preview.md) > [PreviewNavigatorProps](./carbonio-ui-preview.previewnavigatorprops.md) > [nextTooltip](./carbonio-ui-preview.previewnavigatorprops.nexttooltip.md) | ||
|
||
## PreviewNavigatorProps.nextTooltip property | ||
|
||
Tooltip for the next icon button | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
nextTooltip?: string; | ||
``` |
13 changes: 13 additions & 0 deletions
13
docs/api/carbonio-ui-preview.previewnavigatorprops.previoustooltip.md
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,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@zextras/carbonio-ui-preview](./carbonio-ui-preview.md) > [PreviewNavigatorProps](./carbonio-ui-preview.previewnavigatorprops.md) > [previousTooltip](./carbonio-ui-preview.previewnavigatorprops.previoustooltip.md) | ||
|
||
## PreviewNavigatorProps.previousTooltip property | ||
|
||
Tooltip for the previous icon button | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
previousTooltip?: string; | ||
``` |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com> | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
import { PreviewNavigator } from './PreviewNavigator.js'; | ||
import { setup, screen } from '../tests/utils.js'; | ||
|
||
describe('PreviewNavigator', () => { | ||
describe('Previous/Next icon buttons', () => { | ||
it('render the "previous" button', () => { | ||
setup(<PreviewNavigator onClose={jest.fn()} show onPreviousPreview={jest.fn()} />); | ||
expect(screen.getByRoleWithIcon('button', { icon: 'icon: ArrowBackOutline' })).toBeVisible(); | ||
}); | ||
|
||
it('render the tooltip "Previous" when the user hovers on the previous button', async () => { | ||
const { user } = setup( | ||
<PreviewNavigator onClose={jest.fn()} show onPreviousPreview={jest.fn()} /> | ||
); | ||
await user.hover(screen.getByRoleWithIcon('button', { icon: 'icon: ArrowBackOutline' })); | ||
expect(await screen.findByText(/previous/i)).toBeVisible(); | ||
}); | ||
|
||
it('render the "next" button', () => { | ||
setup(<PreviewNavigator onClose={jest.fn()} show onNextPreview={jest.fn()} />); | ||
expect( | ||
screen.getByRoleWithIcon('button', { icon: 'icon: ArrowForwardOutline' }) | ||
).toBeVisible(); | ||
}); | ||
|
||
it('render the tooltip "Next" when the user hovers on the next button', async () => { | ||
const { user } = setup( | ||
<PreviewNavigator onClose={jest.fn()} show onNextPreview={jest.fn()} /> | ||
); | ||
await user.hover(screen.getByRoleWithIcon('button', { icon: 'icon: ArrowForwardOutline' })); | ||
expect(await screen.findByText(/next/i)).toBeVisible(); | ||
}); | ||
}); | ||
}); |
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