@scality/core-ui 0.152.0 → 0.153.0
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.
|
@@ -217,7 +217,7 @@ function NonWrappedIcon({ name, size = '1x', color = undefined, ariaLabel = '',
|
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
219
|
});
|
|
220
|
-
return (_jsxs(_Fragment, { children: [(status === 'loading' || status === 'error') && (_jsx(DelayedFallback, { "aria-label": `${name} ${ariaLabel}`, children: _jsx(Loader, { size: "base" }) })), status === 'success' && (_jsx(data.default, { name: name, color: color, size: size, ariaLabel: ariaLabel, title: title
|
|
220
|
+
return (_jsxs(_Fragment, { children: [(status === 'loading' || status === 'error') && (_jsx(DelayedFallback, { "aria-label": `${name} ${ariaLabel}`, children: _jsx(Loader, { size: "base" }) })), status === 'success' && (_jsx(data.default, { name: name, color: color, size: size, ariaLabel: ariaLabel, title: title, ...rest }))] }));
|
|
221
221
|
}
|
|
222
222
|
function Icon({ withWrapper, ...props }) {
|
|
223
223
|
if (withWrapper) {
|
package/package.json
CHANGED
|
@@ -5,15 +5,15 @@ import { getWrapper } from '../../testUtils';
|
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
import { IconHelp } from './IconHelper';
|
|
7
7
|
|
|
8
|
-
describe('
|
|
8
|
+
describe('IconHelper', () => {
|
|
9
9
|
const selectors = {
|
|
10
|
-
icon: () => screen.getByRole('img'
|
|
10
|
+
icon: () => screen.getByRole('img'),
|
|
11
11
|
};
|
|
12
12
|
const renderIcon = (tooltipMessage: React.ReactNode) => {
|
|
13
13
|
const { Wrapper } = getWrapper();
|
|
14
14
|
render(
|
|
15
15
|
<Wrapper>
|
|
16
|
-
<IconHelp tooltipMessage={tooltipMessage} />
|
|
16
|
+
<IconHelp tooltipMessage={tooltipMessage} title="Info" />
|
|
17
17
|
</Wrapper>,
|
|
18
18
|
);
|
|
19
19
|
};
|
|
@@ -41,12 +41,12 @@ describe('Icon', () => {
|
|
|
41
41
|
<Wrapper>
|
|
42
42
|
<IconHelp
|
|
43
43
|
tooltipMessage={'This is a tooltip'}
|
|
44
|
-
title="Info Helper
|
|
44
|
+
title="Info Helper Testing"
|
|
45
45
|
/>
|
|
46
46
|
</Wrapper>,
|
|
47
47
|
);
|
|
48
48
|
await waitFor(() => {
|
|
49
|
-
expect(screen.getByLabelText('Info Helper
|
|
49
|
+
expect(screen.getByLabelText('Info Helper Testing')).toBeInTheDocument();
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
});
|