@react-magma/charts 17.0.0-next.3 → 17.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.js +2 -1
- package/dist/charts.js.map +1 -1
- package/dist/charts.modern.module.js +2 -1
- package/dist/charts.modern.module.js.map +1 -1
- package/dist/charts.umd.js +2 -1
- package/dist/charts.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CarbonChart/CarbonChart.test.js +6 -2
- package/src/components/ChartTable/ChartMoreOptionsButton.tsx +10 -7
- package/src/components/ChartTable/ChartTable.test.js +6 -1
package/package.json
CHANGED
|
@@ -1063,7 +1063,9 @@ describe('CarbonChart', () => {
|
|
|
1063
1063
|
|
|
1064
1064
|
expect(wrapper).not.toHaveClass('has-magma-toolbar');
|
|
1065
1065
|
|
|
1066
|
-
|
|
1066
|
+
act(() => {
|
|
1067
|
+
jest.runOnlyPendingTimers();
|
|
1068
|
+
});
|
|
1067
1069
|
expect(wrapper).toHaveClass('has-magma-toolbar');
|
|
1068
1070
|
} finally {
|
|
1069
1071
|
jest.useRealTimers();
|
|
@@ -1090,7 +1092,9 @@ describe('CarbonChart', () => {
|
|
|
1090
1092
|
expect(exportToJPG).toHaveBeenCalledTimes(1);
|
|
1091
1093
|
expect(wrapper).not.toHaveClass('has-magma-toolbar');
|
|
1092
1094
|
|
|
1093
|
-
|
|
1095
|
+
act(() => {
|
|
1096
|
+
jest.runOnlyPendingTimers();
|
|
1097
|
+
});
|
|
1094
1098
|
expect(wrapper).toHaveClass('has-magma-toolbar');
|
|
1095
1099
|
} finally {
|
|
1096
1100
|
jest.useRealTimers();
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Dropdown,
|
|
7
7
|
DropdownButton,
|
|
8
8
|
DropdownContent,
|
|
9
|
+
Tooltip,
|
|
9
10
|
} from 'react-magma-dom';
|
|
10
11
|
|
|
11
12
|
import { useChartToolbarI18n } from './chartToolbarI18n';
|
|
@@ -38,13 +39,15 @@ export function ChartMoreOptionsButton({
|
|
|
38
39
|
|
|
39
40
|
return (
|
|
40
41
|
<Dropdown isInverse={isInverse}>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
<Tooltip content={resolvedAriaLabel} isInverse={isInverse}>
|
|
43
|
+
<DropdownButton
|
|
44
|
+
aria-label={resolvedAriaLabel}
|
|
45
|
+
color={ButtonColor.subtle}
|
|
46
|
+
icon={icon}
|
|
47
|
+
variant={ButtonVariant.link}
|
|
48
|
+
testId="chart-more-options-button"
|
|
49
|
+
/>
|
|
50
|
+
</Tooltip>
|
|
48
51
|
<DropdownContent>{children}</DropdownContent>
|
|
49
52
|
</Dropdown>
|
|
50
53
|
);
|
|
@@ -372,7 +372,7 @@ describe('ChartFullscreenButton', () => {
|
|
|
372
372
|
// ChartMoreOptionsButton
|
|
373
373
|
// ---------------------------------------------------------------------------
|
|
374
374
|
describe('ChartMoreOptionsButton', () => {
|
|
375
|
-
it('renders with default "More options" label', () => {
|
|
375
|
+
it('renders with default "More options" label and tooltip', async () => {
|
|
376
376
|
render(
|
|
377
377
|
<ChartMoreOptionsButton icon={<MoreVertIcon />}>
|
|
378
378
|
<DropdownMenuItem>Download</DropdownMenuItem>
|
|
@@ -382,6 +382,11 @@ describe('ChartMoreOptionsButton', () => {
|
|
|
382
382
|
expect(
|
|
383
383
|
screen.getByRole('button', { name: 'More options' })
|
|
384
384
|
).toHaveAttribute('color', 'subtle');
|
|
385
|
+
|
|
386
|
+
fireEvent.mouseEnter(screen.getByRole('button', { name: 'More options' }));
|
|
387
|
+
await waitFor(() => {
|
|
388
|
+
expect(screen.getByText('More options')).toBeInTheDocument();
|
|
389
|
+
});
|
|
385
390
|
});
|
|
386
391
|
|
|
387
392
|
it('renders with custom aria-label', () => {
|