@ssa-ui-kit/widgets 0.0.31-alpha → 0.0.34-alpha

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssa-ui-kit/widgets",
3
- "version": "0.0.31-alpha",
3
+ "version": "0.0.34-alpha",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "private": false,
@@ -29,9 +29,9 @@
29
29
  "js-tokens": "^4.0.0",
30
30
  "loose-envify": "^1.4.0",
31
31
  "scheduler": "^0.23.0",
32
- "@ssa-ui-kit/core": "^0.0.28-alpha",
33
- "@ssa-ui-kit/utils": "^0.0.1-alpha",
34
- "@ssa-ui-kit/hooks": "^0.0.2-alpha"
32
+ "@ssa-ui-kit/core": "^0.0.33-alpha",
33
+ "@ssa-ui-kit/hooks": "^0.0.2-alpha",
34
+ "@ssa-ui-kit/utils": "^0.0.1-alpha"
35
35
  },
36
36
  "browserslist": [
37
37
  ">0.1%",
@@ -58,6 +58,7 @@
58
58
  "@nivo/core": "^0.83.0",
59
59
  "@nivo/line": "^0.83.0",
60
60
  "@nivo/scales": "^0.83.0",
61
+ "@nivo/pie": "^0.83.0",
61
62
  "react": "18.x",
62
63
  "react-dom": "18.x",
63
64
  "react-hook-form": "^7.46.1",
@@ -3,21 +3,15 @@ import { MemoryRouter, Route, Routes } from 'react-router-dom';
3
3
  import { data } from './stories/fixtures';
4
4
  import { AccountBalance } from './index';
5
5
 
6
- const ResponsivePieMock = () => <div data-testid="responsive-pie"></div>;
7
-
8
- jest.mock('@nivo/pie', () => ({
9
- PieCustomLayerProps: {},
10
- ResponsivePie: ResponsivePieMock,
11
- }));
12
-
13
6
  describe('AccountBalance', () => {
14
7
  it('Renders', () => {
15
- const { getByRole, getByText, getByTestId } = render(
8
+ const { getByRole, getByText, container } = render(
16
9
  <AccountBalance total="798" currency="USDT" data={data} />,
17
10
  );
11
+ const pieChartWrapper = container.querySelector('.pie-chart-wrapper');
12
+ expect(pieChartWrapper).toBeInTheDocument();
18
13
 
19
14
  getByRole('heading', { name: 'Balance' });
20
- getByTestId('responsive-pie');
21
15
  getByText('798');
22
16
  getByText('USDT');
23
17
 
@@ -11,13 +11,6 @@ const commonProps = {
11
11
  onDelete: jest.fn(),
12
12
  };
13
13
 
14
- const ResponsivePieMock = () => <div data-testid="responsive-pie"></div>;
15
-
16
- jest.mock('@nivo/pie', () => ({
17
- PieCustomLayerProps: {},
18
- ResponsivePie: ResponsivePieMock,
19
- }));
20
-
21
14
  describe('ExchangeAccount', () => {
22
15
  it('Renders with platform', () => {
23
16
  const { getByText } = render(<ExchangeAccount {...commonProps} />);
@@ -42,9 +35,10 @@ describe('ExchangeAccount', () => {
42
35
  });
43
36
 
44
37
  it('Renders with BalancePieChart component', () => {
45
- const { getByTestId } = render(<ExchangeAccount {...commonProps} />);
38
+ const { container } = render(<ExchangeAccount {...commonProps} />);
46
39
 
47
- getByTestId('responsive-pie');
40
+ const pieChartWrapper = container.querySelector('.pie-chart-wrapper');
41
+ expect(pieChartWrapper).toBeInTheDocument();
48
42
  });
49
43
 
50
44
  it('Clicks on delete button', async () => {
@@ -34,11 +34,9 @@
34
34
  "include": ["src/**/*"],
35
35
  "exclude": [
36
36
  "dist/**/*",
37
- "src/**/*.spec.ts",
38
- "src/**/*.spec.tsx",
39
- "src/**/*.e2e.ts",
40
- "src/**/*.e2e.tsx",
41
- "src/**/*.stories.tsx",
42
- "src/**/*.stories.ts"
37
+ "src/**/*.spec.*",
38
+ "src/**/*.spec.old.*",
39
+ "src/**/*.e2e.*",
40
+ "src/**/*.stories.*"
43
41
  ]
44
42
  }
package/webpack.config.js CHANGED
@@ -19,6 +19,7 @@ module.exports = () => {
19
19
  '@emotion/styled': '@emotion/styled',
20
20
  '@nivo/core': '@nivo/core',
21
21
  '@nivo/line': '@nivo/line',
22
+ '@nivo/pie': '@nivo/pie',
22
23
  '@nivo/scales': '@nivo/scales',
23
24
  },
24
25
  });