@zohodesk/components 1.0.0-alpha-265 → 1.0.0-alpha-267
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/README.md +11 -0
- package/assets/Appearance/dark/mode/darkMode.module.css +181 -180
- package/assets/Appearance/dark/themes/blue/blueDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +31 -31
- package/assets/Appearance/dark/themes/green/greenDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/green/greenDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/orange/orangeDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/red/redDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/red/redDarkCTATheme.module.css +30 -30
- package/assets/Appearance/dark/themes/yellow/yellowDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +30 -30
- package/assets/Appearance/default/mode/defaultMode.module.css +177 -176
- package/assets/Appearance/default/themes/blue/blueDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +31 -31
- package/assets/Appearance/default/themes/green/greenDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/green/greenDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/orange/orangeDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/red/redDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/red/redDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/default/themes/yellow/yellowDefaultCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +182 -181
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css +31 -31
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css +30 -30
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTAModifyCategory.module.css +452 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css +30 -30
- package/assets/Contrast/darkContrastLightness.module.css +39 -0
- package/assets/Contrast/defaultContrastLightness.module.css +39 -0
- package/assets/Contrast/pureDarkContrastLightness.module.css +39 -0
- package/es/AppContainer/AppContainer.js +1 -0
- package/es/Avatar/Avatar.module.css +48 -13
- package/es/Button/Button.js +44 -47
- package/es/Button/{Button.module.css → css/Button.module.css} +6 -6
- package/es/Button/css/cssJSLogic.js +53 -0
- package/es/Button/index.js +2 -0
- package/es/Button/props/propTypes.js +3 -1
- package/es/Buttongroup/Buttongroup.module.css +36 -18
- package/es/DateTime/DateTime.module.css +1 -1
- package/es/DropBox/DropBox.js +2 -2
- package/es/DropBox/DropBoxElement/DropBoxElement.js +5 -3
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -10
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +8 -8
- package/es/DropBox/css/DropBox.module.css +1 -1
- package/es/Ribbon/Ribbon.module.css +102 -24
- package/es/Select/Select.js +12 -2
- package/es/Select/props/defaultProps.js +2 -1
- package/es/Select/props/propTypes.js +2 -1
- package/es/Switch/Switch.module.css +26 -9
- package/es/Tab/Tabs.module.css +6 -2
- package/es/Tooltip/Tooltip.module.css +28 -3
- package/es/common/a11y.module.css +3 -3
- package/es/common/boxShadow.module.css +34 -0
- package/lib/AppContainer/AppContainer.js +1 -0
- package/lib/Avatar/Avatar.module.css +48 -13
- package/lib/Button/Button.js +43 -72
- package/lib/Button/{Button.module.css → css/Button.module.css} +6 -6
- package/lib/Button/css/cssJSLogic.js +40 -0
- package/lib/Button/index.js +20 -0
- package/lib/Button/props/propTypes.js +5 -2
- package/lib/Buttongroup/Buttongroup.module.css +36 -18
- package/lib/DateTime/DateTime.module.css +1 -1
- package/lib/DropBox/DropBox.js +2 -2
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +5 -3
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -10
- package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +5 -5
- package/lib/DropBox/css/DropBox.module.css +1 -1
- package/lib/Ribbon/Ribbon.module.css +102 -24
- package/lib/Select/Select.js +12 -2
- package/lib/Select/props/defaultProps.js +2 -1
- package/lib/Select/props/propTypes.js +2 -1
- package/lib/Switch/Switch.module.css +26 -9
- package/lib/Tab/Tabs.module.css +6 -2
- package/lib/Tooltip/Tooltip.module.css +28 -3
- package/lib/common/a11y.module.css +3 -3
- package/lib/common/boxShadow.module.css +34 -0
- package/package.json +26 -13
- package/es/Button/__tests__/Button.spec.js +0 -190
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
- package/lib/Button/__tests__/Button.spec.js +0 -193
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Button component should is not bold 1`] = `
|
|
4
|
-
<button
|
|
5
|
-
className=" primary medium "
|
|
6
|
-
data-id="buttonComp"
|
|
7
|
-
disabled={false}
|
|
8
|
-
onClick={[Function]}
|
|
9
|
-
type="button"
|
|
10
|
-
>
|
|
11
|
-
secondaryFilled
|
|
12
|
-
</button>
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`Button component should is rounded 1`] = `
|
|
16
|
-
<button
|
|
17
|
-
className=" primary rounded medium bold "
|
|
18
|
-
data-id="buttonComp"
|
|
19
|
-
disabled={false}
|
|
20
|
-
onClick={[Function]}
|
|
21
|
-
type="button"
|
|
22
|
-
>
|
|
23
|
-
secondaryFilled
|
|
24
|
-
</button>
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`Button component should the palette is danger 1`] = `
|
|
28
|
-
<button
|
|
29
|
-
className=" danger medium bold "
|
|
30
|
-
data-id="buttonComp"
|
|
31
|
-
disabled={false}
|
|
32
|
-
onClick={[Function]}
|
|
33
|
-
type="button"
|
|
34
|
-
>
|
|
35
|
-
danger
|
|
36
|
-
</button>
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
exports[`Button component should the palette is dangerFilled 1`] = `
|
|
40
|
-
<button
|
|
41
|
-
className=" dangerfilled medium bold "
|
|
42
|
-
data-id="buttonComp"
|
|
43
|
-
disabled={false}
|
|
44
|
-
onClick={[Function]}
|
|
45
|
-
type="button"
|
|
46
|
-
>
|
|
47
|
-
dangerFilled
|
|
48
|
-
</button>
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
exports[`Button component should the palette is plainPrimary 1`] = `
|
|
52
|
-
<button
|
|
53
|
-
className=" plainprimary medium bold "
|
|
54
|
-
data-id="buttonComp"
|
|
55
|
-
disabled={false}
|
|
56
|
-
onClick={[Function]}
|
|
57
|
-
type="button"
|
|
58
|
-
>
|
|
59
|
-
primary
|
|
60
|
-
</button>
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
exports[`Button component should the palette is plainSecondary 1`] = `
|
|
64
|
-
<button
|
|
65
|
-
className=" plainsecondary medium bold "
|
|
66
|
-
data-id="buttonComp"
|
|
67
|
-
disabled={false}
|
|
68
|
-
onClick={[Function]}
|
|
69
|
-
type="button"
|
|
70
|
-
>
|
|
71
|
-
plainSecondary
|
|
72
|
-
</button>
|
|
73
|
-
`;
|
|
74
|
-
|
|
75
|
-
exports[`Button component should the palette is primaryFilled 1`] = `
|
|
76
|
-
<button
|
|
77
|
-
className=" primaryfilled medium bold "
|
|
78
|
-
data-id="buttonComp"
|
|
79
|
-
disabled={false}
|
|
80
|
-
onClick={[Function]}
|
|
81
|
-
type="button"
|
|
82
|
-
>
|
|
83
|
-
primaryFilled
|
|
84
|
-
</button>
|
|
85
|
-
`;
|
|
86
|
-
|
|
87
|
-
exports[`Button component should the palette is secondary 1`] = `
|
|
88
|
-
<button
|
|
89
|
-
className=" secondary medium bold "
|
|
90
|
-
data-id="buttonComp"
|
|
91
|
-
disabled={false}
|
|
92
|
-
onClick={[Function]}
|
|
93
|
-
type="button"
|
|
94
|
-
>
|
|
95
|
-
secondary
|
|
96
|
-
</button>
|
|
97
|
-
`;
|
|
98
|
-
|
|
99
|
-
exports[`Button component should the palette is secondaryFilled 1`] = `
|
|
100
|
-
<button
|
|
101
|
-
className=" secondaryfilled medium bold "
|
|
102
|
-
data-id="buttonComp"
|
|
103
|
-
disabled={false}
|
|
104
|
-
onClick={[Function]}
|
|
105
|
-
type="button"
|
|
106
|
-
>
|
|
107
|
-
secondaryFilled
|
|
108
|
-
</button>
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
exports[`Button component should the size is large 1`] = `
|
|
112
|
-
<button
|
|
113
|
-
className=" primary rounded large bold "
|
|
114
|
-
data-id="buttonComp"
|
|
115
|
-
disabled={false}
|
|
116
|
-
onClick={[Function]}
|
|
117
|
-
type="button"
|
|
118
|
-
>
|
|
119
|
-
large
|
|
120
|
-
</button>
|
|
121
|
-
`;
|
|
122
|
-
|
|
123
|
-
exports[`Button component should the size is small 1`] = `
|
|
124
|
-
<button
|
|
125
|
-
className=" primary rounded small bold "
|
|
126
|
-
data-id="buttonComp"
|
|
127
|
-
disabled={false}
|
|
128
|
-
onClick={[Function]}
|
|
129
|
-
type="button"
|
|
130
|
-
>
|
|
131
|
-
small
|
|
132
|
-
</button>
|
|
133
|
-
`;
|
|
134
|
-
|
|
135
|
-
exports[`Button component should the size is xlarge 1`] = `
|
|
136
|
-
<button
|
|
137
|
-
className=" primary rounded xlarge bold "
|
|
138
|
-
data-id="buttonComp"
|
|
139
|
-
disabled={false}
|
|
140
|
-
onClick={[Function]}
|
|
141
|
-
type="button"
|
|
142
|
-
>
|
|
143
|
-
xlarge
|
|
144
|
-
</button>
|
|
145
|
-
`;
|
|
146
|
-
|
|
147
|
-
exports[`Button component should the status is loading 1`] = `
|
|
148
|
-
<button
|
|
149
|
-
className=" primary rounded medium bold "
|
|
150
|
-
data-id="buttonComp"
|
|
151
|
-
disabled={true}
|
|
152
|
-
onClick={[Function]}
|
|
153
|
-
type="button"
|
|
154
|
-
>
|
|
155
|
-
secondaryFilled
|
|
156
|
-
<div
|
|
157
|
-
className="overlay"
|
|
158
|
-
>
|
|
159
|
-
<div
|
|
160
|
-
className="loading"
|
|
161
|
-
>
|
|
162
|
-
<div
|
|
163
|
-
className="element"
|
|
164
|
-
/>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
</button>
|
|
168
|
-
`;
|
|
169
|
-
|
|
170
|
-
exports[`Button component should the status is success 1`] = `
|
|
171
|
-
<button
|
|
172
|
-
className=" primary rounded medium bold "
|
|
173
|
-
data-id="buttonComp"
|
|
174
|
-
disabled={false}
|
|
175
|
-
onClick={[Function]}
|
|
176
|
-
type="button"
|
|
177
|
-
>
|
|
178
|
-
secondaryFilled
|
|
179
|
-
<div
|
|
180
|
-
className="overlay"
|
|
181
|
-
>
|
|
182
|
-
<div
|
|
183
|
-
className="success"
|
|
184
|
-
>
|
|
185
|
-
<div
|
|
186
|
-
className="element"
|
|
187
|
-
/>
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
</button>
|
|
191
|
-
`;
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
var _Button = _interopRequireDefault(require("../Button"));
|
|
5
|
-
var _testUtils = _interopRequireDefault(require("react-dom/test-utils"));
|
|
6
|
-
var _reactTestRenderer = _interopRequireDefault(require("react-test-renderer"));
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8
|
-
describe('Button component', function () {
|
|
9
|
-
it('should display text', function () {
|
|
10
|
-
var renderedDOM = _testUtils["default"].renderIntoDocument( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
11
|
-
text: "primary",
|
|
12
|
-
palette: "primary"
|
|
13
|
-
}));
|
|
14
|
-
expect(_testUtils["default"].findRenderedComponentsWithTestid(renderedDOM, 'buttonComp').textContent.contains('primary')).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
it('should be able to click', function () {
|
|
17
|
-
var mockfn = jest.fn();
|
|
18
|
-
var renderedDOM = _testUtils["default"].renderIntoDocument( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
19
|
-
text: "primary",
|
|
20
|
-
palette: "primary",
|
|
21
|
-
onClick: mockfn
|
|
22
|
-
}));
|
|
23
|
-
var buttonEle = _testUtils["default"].findRenderedComponentsWithTestid(renderedDOM, 'buttonComp');
|
|
24
|
-
_testUtils["default"].Simulate.click(buttonEle);
|
|
25
|
-
expect(mockfn.mock.calls.length).toBe(1);
|
|
26
|
-
});
|
|
27
|
-
it('should not able to click', function () {
|
|
28
|
-
var mockfn = jest.fn();
|
|
29
|
-
var renderedDOM = _testUtils["default"].renderIntoDocument( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
30
|
-
text: "primary",
|
|
31
|
-
palette: "primary",
|
|
32
|
-
onClick: mockfn,
|
|
33
|
-
disabled: true
|
|
34
|
-
}));
|
|
35
|
-
var buttonEle = _testUtils["default"].findRenderedComponentsWithTestid(renderedDOM, 'buttonComp_disabled');
|
|
36
|
-
_testUtils["default"].Simulate.click(buttonEle);
|
|
37
|
-
expect(mockfn.mock.calls.length).toBe(0);
|
|
38
|
-
});
|
|
39
|
-
it('should not able to click on loading status', function () {
|
|
40
|
-
var mockfn = jest.fn();
|
|
41
|
-
var renderedDOM = _testUtils["default"].renderIntoDocument( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
42
|
-
text: "primary",
|
|
43
|
-
palette: "primary",
|
|
44
|
-
onClick: mockfn,
|
|
45
|
-
status: "loading"
|
|
46
|
-
}));
|
|
47
|
-
var buttonEle = _testUtils["default"].findRenderedComponentsWithTestid(renderedDOM, 'buttonComp');
|
|
48
|
-
_testUtils["default"].Simulate.click(buttonEle);
|
|
49
|
-
expect(mockfn.mock.calls.length).toBe(0);
|
|
50
|
-
});
|
|
51
|
-
it('should able to click other than loading status', function () {
|
|
52
|
-
var mockfn = jest.fn();
|
|
53
|
-
var renderedDOM = _testUtils["default"].renderIntoDocument( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
54
|
-
text: "primary",
|
|
55
|
-
palette: "primary",
|
|
56
|
-
onClick: mockfn,
|
|
57
|
-
status: "success"
|
|
58
|
-
}));
|
|
59
|
-
var buttonEle = _testUtils["default"].findRenderedComponentsWithTestid(renderedDOM, 'buttonComp');
|
|
60
|
-
_testUtils["default"].Simulate.click(buttonEle);
|
|
61
|
-
expect(mockfn.mock.calls.length).toBe(1);
|
|
62
|
-
});
|
|
63
|
-
it('should able to click and click arguments should be event object', function () {
|
|
64
|
-
var mockfn = jest.fn();
|
|
65
|
-
var renderedDOM = _testUtils["default"].renderIntoDocument( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
66
|
-
text: "primary",
|
|
67
|
-
palette: "primary",
|
|
68
|
-
onClick: mockfn,
|
|
69
|
-
status: "success"
|
|
70
|
-
}));
|
|
71
|
-
var buttonEle = _testUtils["default"].findRenderedComponentsWithTestid(renderedDOM, 'buttonComp');
|
|
72
|
-
_testUtils["default"].Simulate.click(buttonEle);
|
|
73
|
-
expect(mockfn.mock.calls.length).toBe(1);
|
|
74
|
-
expect(mockfn.mock.calls[0].length).toBe(1);
|
|
75
|
-
});
|
|
76
|
-
it('should the palette is plainPrimary', function () {
|
|
77
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
78
|
-
text: "primary",
|
|
79
|
-
palette: "plainPrimary"
|
|
80
|
-
}));
|
|
81
|
-
var tree = ele.toJSON();
|
|
82
|
-
expect(tree).toMatchSnapshot();
|
|
83
|
-
});
|
|
84
|
-
it('should the palette is plainSecondary', function () {
|
|
85
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
86
|
-
text: "plainSecondary",
|
|
87
|
-
palette: "plainSecondary"
|
|
88
|
-
}));
|
|
89
|
-
var tree = ele.toJSON();
|
|
90
|
-
expect(tree).toMatchSnapshot();
|
|
91
|
-
});
|
|
92
|
-
it('should the palette is primaryFilled', function () {
|
|
93
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
94
|
-
text: "primaryFilled",
|
|
95
|
-
palette: "primaryFilled"
|
|
96
|
-
}));
|
|
97
|
-
var tree = ele.toJSON();
|
|
98
|
-
expect(tree).toMatchSnapshot();
|
|
99
|
-
});
|
|
100
|
-
it('should the palette is danger', function () {
|
|
101
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
102
|
-
text: "danger",
|
|
103
|
-
palette: "danger"
|
|
104
|
-
}));
|
|
105
|
-
var tree = ele.toJSON();
|
|
106
|
-
expect(tree).toMatchSnapshot();
|
|
107
|
-
});
|
|
108
|
-
it('should the palette is dangerFilled', function () {
|
|
109
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
110
|
-
text: "dangerFilled",
|
|
111
|
-
palette: "dangerFilled"
|
|
112
|
-
}));
|
|
113
|
-
var tree = ele.toJSON();
|
|
114
|
-
expect(tree).toMatchSnapshot();
|
|
115
|
-
});
|
|
116
|
-
it('should the palette is secondary', function () {
|
|
117
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
118
|
-
text: "secondary",
|
|
119
|
-
palette: "secondary"
|
|
120
|
-
}));
|
|
121
|
-
var tree = ele.toJSON();
|
|
122
|
-
expect(tree).toMatchSnapshot();
|
|
123
|
-
});
|
|
124
|
-
it('should the palette is secondaryFilled', function () {
|
|
125
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
126
|
-
text: "secondaryFilled",
|
|
127
|
-
palette: "secondaryFilled"
|
|
128
|
-
}));
|
|
129
|
-
var tree = ele.toJSON();
|
|
130
|
-
expect(tree).toMatchSnapshot();
|
|
131
|
-
});
|
|
132
|
-
it('should is not bold', function () {
|
|
133
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
134
|
-
text: "secondaryFilled",
|
|
135
|
-
isBold: false
|
|
136
|
-
}));
|
|
137
|
-
var tree = ele.toJSON();
|
|
138
|
-
expect(tree).toMatchSnapshot();
|
|
139
|
-
});
|
|
140
|
-
it('should is rounded', function () {
|
|
141
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
142
|
-
text: "secondaryFilled",
|
|
143
|
-
rounded: true
|
|
144
|
-
}));
|
|
145
|
-
var tree = ele.toJSON();
|
|
146
|
-
expect(tree).toMatchSnapshot();
|
|
147
|
-
});
|
|
148
|
-
it('should the size is small', function () {
|
|
149
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
150
|
-
text: "small",
|
|
151
|
-
rounded: true,
|
|
152
|
-
size: "small"
|
|
153
|
-
}));
|
|
154
|
-
var tree = ele.toJSON();
|
|
155
|
-
expect(tree).toMatchSnapshot();
|
|
156
|
-
});
|
|
157
|
-
it('should the size is large', function () {
|
|
158
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
159
|
-
text: "large",
|
|
160
|
-
rounded: true,
|
|
161
|
-
size: "large"
|
|
162
|
-
}));
|
|
163
|
-
var tree = ele.toJSON();
|
|
164
|
-
expect(tree).toMatchSnapshot();
|
|
165
|
-
});
|
|
166
|
-
it('should the size is xlarge', function () {
|
|
167
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
168
|
-
text: "xlarge",
|
|
169
|
-
rounded: true,
|
|
170
|
-
size: "xlarge"
|
|
171
|
-
}));
|
|
172
|
-
var tree = ele.toJSON();
|
|
173
|
-
expect(tree).toMatchSnapshot();
|
|
174
|
-
});
|
|
175
|
-
it('should the status is loading', function () {
|
|
176
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
177
|
-
text: "secondaryFilled",
|
|
178
|
-
rounded: true,
|
|
179
|
-
status: "loading"
|
|
180
|
-
}));
|
|
181
|
-
var tree = ele.toJSON();
|
|
182
|
-
expect(tree).toMatchSnapshot();
|
|
183
|
-
});
|
|
184
|
-
it('should the status is success', function () {
|
|
185
|
-
var ele = _reactTestRenderer["default"].create( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
186
|
-
text: "secondaryFilled",
|
|
187
|
-
rounded: true,
|
|
188
|
-
status: "success"
|
|
189
|
-
}));
|
|
190
|
-
var tree = ele.toJSON();
|
|
191
|
-
expect(tree).toMatchSnapshot();
|
|
192
|
-
});
|
|
193
|
-
});
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Button component should is not bold 1`] = `
|
|
4
|
-
<button
|
|
5
|
-
className=" primary medium "
|
|
6
|
-
data-id="buttonComp"
|
|
7
|
-
disabled={false}
|
|
8
|
-
onClick={[Function]}
|
|
9
|
-
type="button"
|
|
10
|
-
>
|
|
11
|
-
secondaryFilled
|
|
12
|
-
</button>
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`Button component should is rounded 1`] = `
|
|
16
|
-
<button
|
|
17
|
-
className=" primary rounded medium bold "
|
|
18
|
-
data-id="buttonComp"
|
|
19
|
-
disabled={false}
|
|
20
|
-
onClick={[Function]}
|
|
21
|
-
type="button"
|
|
22
|
-
>
|
|
23
|
-
secondaryFilled
|
|
24
|
-
</button>
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`Button component should the palette is danger 1`] = `
|
|
28
|
-
<button
|
|
29
|
-
className=" danger medium bold "
|
|
30
|
-
data-id="buttonComp"
|
|
31
|
-
disabled={false}
|
|
32
|
-
onClick={[Function]}
|
|
33
|
-
type="button"
|
|
34
|
-
>
|
|
35
|
-
danger
|
|
36
|
-
</button>
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
exports[`Button component should the palette is dangerFilled 1`] = `
|
|
40
|
-
<button
|
|
41
|
-
className=" dangerfilled medium bold "
|
|
42
|
-
data-id="buttonComp"
|
|
43
|
-
disabled={false}
|
|
44
|
-
onClick={[Function]}
|
|
45
|
-
type="button"
|
|
46
|
-
>
|
|
47
|
-
dangerFilled
|
|
48
|
-
</button>
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
exports[`Button component should the palette is plainPrimary 1`] = `
|
|
52
|
-
<button
|
|
53
|
-
className=" plainprimary medium bold "
|
|
54
|
-
data-id="buttonComp"
|
|
55
|
-
disabled={false}
|
|
56
|
-
onClick={[Function]}
|
|
57
|
-
type="button"
|
|
58
|
-
>
|
|
59
|
-
primary
|
|
60
|
-
</button>
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
exports[`Button component should the palette is plainSecondary 1`] = `
|
|
64
|
-
<button
|
|
65
|
-
className=" plainsecondary medium bold "
|
|
66
|
-
data-id="buttonComp"
|
|
67
|
-
disabled={false}
|
|
68
|
-
onClick={[Function]}
|
|
69
|
-
type="button"
|
|
70
|
-
>
|
|
71
|
-
plainSecondary
|
|
72
|
-
</button>
|
|
73
|
-
`;
|
|
74
|
-
|
|
75
|
-
exports[`Button component should the palette is primaryFilled 1`] = `
|
|
76
|
-
<button
|
|
77
|
-
className=" primaryfilled medium bold "
|
|
78
|
-
data-id="buttonComp"
|
|
79
|
-
disabled={false}
|
|
80
|
-
onClick={[Function]}
|
|
81
|
-
type="button"
|
|
82
|
-
>
|
|
83
|
-
primaryFilled
|
|
84
|
-
</button>
|
|
85
|
-
`;
|
|
86
|
-
|
|
87
|
-
exports[`Button component should the palette is secondary 1`] = `
|
|
88
|
-
<button
|
|
89
|
-
className=" secondary medium bold "
|
|
90
|
-
data-id="buttonComp"
|
|
91
|
-
disabled={false}
|
|
92
|
-
onClick={[Function]}
|
|
93
|
-
type="button"
|
|
94
|
-
>
|
|
95
|
-
secondary
|
|
96
|
-
</button>
|
|
97
|
-
`;
|
|
98
|
-
|
|
99
|
-
exports[`Button component should the palette is secondaryFilled 1`] = `
|
|
100
|
-
<button
|
|
101
|
-
className=" secondaryfilled medium bold "
|
|
102
|
-
data-id="buttonComp"
|
|
103
|
-
disabled={false}
|
|
104
|
-
onClick={[Function]}
|
|
105
|
-
type="button"
|
|
106
|
-
>
|
|
107
|
-
secondaryFilled
|
|
108
|
-
</button>
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
exports[`Button component should the size is large 1`] = `
|
|
112
|
-
<button
|
|
113
|
-
className=" primary rounded large bold "
|
|
114
|
-
data-id="buttonComp"
|
|
115
|
-
disabled={false}
|
|
116
|
-
onClick={[Function]}
|
|
117
|
-
type="button"
|
|
118
|
-
>
|
|
119
|
-
large
|
|
120
|
-
</button>
|
|
121
|
-
`;
|
|
122
|
-
|
|
123
|
-
exports[`Button component should the size is small 1`] = `
|
|
124
|
-
<button
|
|
125
|
-
className=" primary rounded small bold "
|
|
126
|
-
data-id="buttonComp"
|
|
127
|
-
disabled={false}
|
|
128
|
-
onClick={[Function]}
|
|
129
|
-
type="button"
|
|
130
|
-
>
|
|
131
|
-
small
|
|
132
|
-
</button>
|
|
133
|
-
`;
|
|
134
|
-
|
|
135
|
-
exports[`Button component should the size is xlarge 1`] = `
|
|
136
|
-
<button
|
|
137
|
-
className=" primary rounded xlarge bold "
|
|
138
|
-
data-id="buttonComp"
|
|
139
|
-
disabled={false}
|
|
140
|
-
onClick={[Function]}
|
|
141
|
-
type="button"
|
|
142
|
-
>
|
|
143
|
-
xlarge
|
|
144
|
-
</button>
|
|
145
|
-
`;
|
|
146
|
-
|
|
147
|
-
exports[`Button component should the status is loading 1`] = `
|
|
148
|
-
<button
|
|
149
|
-
className=" primary rounded medium bold "
|
|
150
|
-
data-id="buttonComp"
|
|
151
|
-
disabled={true}
|
|
152
|
-
onClick={[Function]}
|
|
153
|
-
type="button"
|
|
154
|
-
>
|
|
155
|
-
secondaryFilled
|
|
156
|
-
<div
|
|
157
|
-
className="overlay"
|
|
158
|
-
>
|
|
159
|
-
<div
|
|
160
|
-
className="loading"
|
|
161
|
-
>
|
|
162
|
-
<div
|
|
163
|
-
className="element"
|
|
164
|
-
/>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
</button>
|
|
168
|
-
`;
|
|
169
|
-
|
|
170
|
-
exports[`Button component should the status is success 1`] = `
|
|
171
|
-
<button
|
|
172
|
-
className=" primary rounded medium bold "
|
|
173
|
-
data-id="buttonComp"
|
|
174
|
-
disabled={false}
|
|
175
|
-
onClick={[Function]}
|
|
176
|
-
type="button"
|
|
177
|
-
>
|
|
178
|
-
secondaryFilled
|
|
179
|
-
<div
|
|
180
|
-
className="overlay"
|
|
181
|
-
>
|
|
182
|
-
<div
|
|
183
|
-
className="success"
|
|
184
|
-
>
|
|
185
|
-
<div
|
|
186
|
-
className="element"
|
|
187
|
-
/>
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
</button>
|
|
191
|
-
`;
|