@transferwise/components 0.0.0-experimental-cf09238 → 0.0.0-experimental-3fbb2ff
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": "@transferwise/components",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-3fbb2ff",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@wise/eslint-config": "^12.3.0",
|
|
85
85
|
"babel-plugin-formatjs": "^10.5.16",
|
|
86
86
|
"enzyme": "^3.11.0",
|
|
87
|
-
"eslint": "^9.
|
|
87
|
+
"eslint": "^9.26.0",
|
|
88
88
|
"gulp": "^5.0.0",
|
|
89
89
|
"jest": "^29.7.0",
|
|
90
90
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -3,15 +3,15 @@ import { render, screen } from '../test-utils';
|
|
|
3
3
|
import ProgressBar from './ProgressBar';
|
|
4
4
|
|
|
5
5
|
describe('ProgressBar', () => {
|
|
6
|
-
const props = {
|
|
7
|
-
description: 'description',
|
|
8
|
-
title: 'title',
|
|
9
|
-
progress: { value: 50, max: 100 },
|
|
10
|
-
textEnd: 'textEnd',
|
|
11
|
-
className: 'className',
|
|
12
|
-
id: 'id',
|
|
13
|
-
};
|
|
14
6
|
describe('by default', () => {
|
|
7
|
+
const props = {
|
|
8
|
+
description: 'description',
|
|
9
|
+
title: 'title',
|
|
10
|
+
progress: { value: 50, max: 100 },
|
|
11
|
+
textEnd: 'textEnd',
|
|
12
|
+
className: 'className',
|
|
13
|
+
id: 'id',
|
|
14
|
+
};
|
|
15
15
|
beforeEach(() => {
|
|
16
16
|
render(<ProgressBar {...props} />);
|
|
17
17
|
});
|
|
@@ -28,4 +28,29 @@ describe('ProgressBar', () => {
|
|
|
28
28
|
expect(screen.getByText('textEnd')).toBeInTheDocument();
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
|
+
describe('with custom React node type as props', () => {
|
|
32
|
+
const props = {
|
|
33
|
+
description: <span>Custom Description</span>,
|
|
34
|
+
title: <span>Custom Title</span>,
|
|
35
|
+
progress: { value: 50, max: 100 },
|
|
36
|
+
textEnd: <span>Custom TextEnd</span>,
|
|
37
|
+
className: 'className',
|
|
38
|
+
id: 'id',
|
|
39
|
+
};
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
render(<ProgressBar {...props} />);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('renders the custom title', () => {
|
|
45
|
+
expect(screen.getByText('Custom Title')).toBeInTheDocument();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('renders the custom description', () => {
|
|
49
|
+
expect(screen.getByText('Custom Description')).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('renders the custom textEnd', () => {
|
|
53
|
+
expect(screen.getByText('Custom TextEnd')).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
31
56
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
|
|
3
3
|
import ProgressBar from './ProgressBar';
|
|
4
|
+
import Info from '../info';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
component: ProgressBar,
|
|
@@ -19,3 +20,17 @@ export const Basic: Story = {
|
|
|
19
20
|
textEnd: '200 GBP to go',
|
|
20
21
|
},
|
|
21
22
|
};
|
|
23
|
+
|
|
24
|
+
export const WithInfoTooltip: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
description: <span>1,000 GBP</span>,
|
|
27
|
+
id: 'progress-bar-id',
|
|
28
|
+
title: (
|
|
29
|
+
<span>
|
|
30
|
+
Total limit <Info content="This is the total limit of your Wise account" />
|
|
31
|
+
</span>
|
|
32
|
+
),
|
|
33
|
+
progress: { value: 800, max: 1000 },
|
|
34
|
+
textEnd: <span>200 GBP remaining</span>,
|
|
35
|
+
},
|
|
36
|
+
};
|