@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 || name, ...rest }))] }));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scality/core-ui",
3
- "version": "0.152.0",
3
+ "version": "0.153.0",
4
4
  "description": "Scality common React component library",
5
5
  "author": "Scality Engineering",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -285,7 +285,7 @@ function NonWrappedIcon({
285
285
  color={color}
286
286
  size={size}
287
287
  ariaLabel={ariaLabel}
288
- title={title || name}
288
+ title={title}
289
289
  {...rest}
290
290
  />
291
291
  )}
@@ -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('Icon', () => {
8
+ describe('IconHelper', () => {
9
9
  const selectors = {
10
- icon: () => screen.getByRole('img', { name: /Info/i }),
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 testing"
44
+ title="Info Helper Testing"
45
45
  />
46
46
  </Wrapper>,
47
47
  );
48
48
  await waitFor(() => {
49
- expect(screen.getByLabelText('Info Helper testing')).toBeInTheDocument();
49
+ expect(screen.getByLabelText('Info Helper Testing')).toBeInTheDocument();
50
50
  });
51
51
  });
52
52
  });