@transferwise/components 0.0.0-experimental-3e2c112 → 0.0.0-experimental-97a0d5e

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-3e2c112",
3
+ "version": "0.0.0-experimental-97a0d5e",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -91,9 +91,9 @@
91
91
  "rollup": "^4.18.1",
92
92
  "rollup-preserve-directives": "^1.1.1",
93
93
  "storybook": "^8.2.2",
94
- "@transferwise/less-config": "3.1.0",
95
94
  "@transferwise/neptune-css": "14.19.0",
96
- "@wise/components-theming": "1.6.0"
95
+ "@wise/components-theming": "1.6.0",
96
+ "@transferwise/less-config": "3.1.0"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@transferwise/icons": "^3.13.1",
@@ -5,6 +5,7 @@ const props = { prop1: 'prop1', prop2: 'prop2' };
5
5
  const validator = jest.fn();
6
6
 
7
7
  describe('deprecated', () => {
8
+ const component = 'Test';
8
9
  const origWarn = console.warn;
9
10
  let mockedWarn;
10
11
 
@@ -22,11 +23,10 @@ describe('deprecated', () => {
22
23
  });
23
24
 
24
25
  describe('if prop has been listed as deprecated', () => {
26
+ const propertyName = 'prop1';
27
+
25
28
  it('calls console.warn with the correct message', () => {
26
- const component = 'Test';
27
29
  const newProperty = 'newProp';
28
- const propertyName = 'prop1';
29
-
30
30
  const expiryDate = new Date('01-01-2000');
31
31
  const expiryDateString = expiryDate.toLocaleString('en-GB', {
32
32
  year: 'numeric',
@@ -42,10 +42,6 @@ describe('deprecated', () => {
42
42
  });
43
43
 
44
44
  it('calls console.warn with correct message if newProp is not provided', () => {
45
- const component = 'Test';
46
-
47
- const propertyName = 'prop1';
48
-
49
45
  const expiryDate = new Date('01-01-2000');
50
46
  const expiryDateString = expiryDate.toLocaleString('en-GB', {
51
47
  year: 'numeric',
@@ -61,8 +57,6 @@ describe('deprecated', () => {
61
57
  });
62
58
 
63
59
  it('calls console.warn with correct message if message is provided', () => {
64
- const component = 'Test';
65
- const propertyName = 'prop1';
66
60
  const message = 'Some custom message.';
67
61
 
68
62
  deprecated(validator, { component, message })(props, propertyName);
@@ -74,15 +68,15 @@ describe('deprecated', () => {
74
68
  });
75
69
 
76
70
  describe('if prop has not been listed as deprecated', () => {
71
+ const propertyName = 'prop3';
72
+
77
73
  it('calls validator with props', () => {
78
- const propertyName = 'prop3';
79
- deprecated(validator, {})(props, propertyName);
74
+ deprecated(validator, { component })(props, propertyName);
80
75
  expect(console.warn).not.toHaveBeenCalled();
81
76
  });
82
77
 
83
78
  it('calls validator with expected args', () => {
84
- const propertyName = 'prop3';
85
- deprecated(validator, {})(props, propertyName);
79
+ deprecated(validator, { component })(props, propertyName);
86
80
  expect(validator).toHaveBeenCalledWith({ prop1: 'prop1', prop2: 'prop2' }, 'prop3');
87
81
  });
88
82
  });