linear-react-components-ui 1.0.11-beta.3 → 1.0.12-beta.1
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/lib/alerts/alert.spec.js +55 -32
- package/lib/avatar/avatar.spec.js +74 -42
- package/lib/badge/badge.spec.js +52 -30
- package/lib/buttons/SpinnerLoading.js +230 -0
- package/lib/buttons/buttons.spec.js +210 -136
- package/lib/calendar/calendar.spec.js +63 -32
- package/lib/checkbox/checkbox.spec.js +78 -37
- package/lib/dialog/dialog.spec.js +153 -80
- package/lib/drawer/Drawer.spec.js +95 -52
- package/lib/dropdown/dropdown.spec.js +58 -34
- package/lib/fieldset/fieldset.spec.js +123 -77
- package/lib/form/FieldNumber.js +6 -2
- package/lib/form/form.spec.js +81 -35
- package/lib/gridlayout/gridLayout.spec.js +70 -43
- package/lib/icons/helper.d.ts +0 -8
- package/lib/icons/helper.js +0 -8
- package/lib/icons/icons.spec.js +36 -20
- package/lib/inputs/base/base.spec.js +291 -176
- package/lib/inputs/base/index.js +1 -0
- package/lib/inputs/color/color_input.spec.js +67 -33
- package/lib/inputs/date/date.spec.js +156 -75
- package/lib/inputs/mask/helpers.js +1 -1
- package/lib/inputs/mask/input_mask.spec.js +290 -177
- package/lib/inputs/number/numberfield.spec.js +83 -42
- package/lib/inputs/search/search_input.spec.js +86 -46
- package/lib/inputs/select/select.spec.js +182 -127
- package/lib/inputs/text/textfield.spec.js +83 -42
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/inputs/textarea/textarea.spec.js +27 -14
- package/lib/labelMessages/labelMessages.spec.js +61 -28
- package/lib/labels/label.spec.js +68 -41
- package/lib/list/list.spec.js +358 -211
- package/lib/menus/float/float-menu.spec.js +61 -27
- package/lib/menus/sidenav/sidenav.spec.js +78 -29
- package/lib/panel/panel.spec.js +106 -69
- package/lib/popover/popover.spec.js +70 -40
- package/lib/progress/progress.spec.js +48 -32
- package/lib/radio/radio.spec.js +59 -25
- package/lib/spinner/spinner.spec.js +65 -43
- package/lib/split/split.spec.js +76 -51
- package/lib/table/table.spec.js +149 -94
- package/lib/tabs/tabs.spec.js +158 -95
- package/lib/toolbar/toolbar.spec.js +182 -134
- package/lib/tooltip/tooltip.spec.js +51 -24
- package/lib/treeview/treeview.spec.js +86 -49
- package/lib/uitour/uitour.spec.js +56 -25
- package/package.json +1 -1
package/lib/labels/label.spec.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
5
7
|
var _react2 = require("@testing-library/react");
|
|
8
|
+
|
|
6
9
|
require("@testing-library/jest-dom/extend-expect");
|
|
10
|
+
|
|
7
11
|
var _index = _interopRequireWildcard(require("./index"));
|
|
12
|
+
|
|
8
13
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
14
|
+
|
|
9
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
|
|
10
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
|
|
11
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
12
21
|
describe('Labels', function () {
|
|
13
22
|
describe('Default', function () {
|
|
14
23
|
var Default = /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
@@ -16,119 +25,137 @@ describe('Labels', function () {
|
|
|
16
25
|
name: "user"
|
|
17
26
|
})
|
|
18
27
|
}, "TESTE");
|
|
28
|
+
|
|
19
29
|
it('should have text content iguals children', function () {
|
|
20
30
|
var _render = (0, _react2.render)(Default),
|
|
21
|
-
|
|
31
|
+
container = _render.container;
|
|
32
|
+
|
|
22
33
|
expect(container.firstChild).toHaveTextContent('TESTE');
|
|
23
34
|
});
|
|
24
35
|
it('should be rendering icon from icon prop', function () {
|
|
25
36
|
var _render2 = (0, _react2.render)(Default),
|
|
26
|
-
|
|
37
|
+
getByTestId = _render2.getByTestId;
|
|
38
|
+
|
|
27
39
|
expect(getByTestId('icon')).toBeTruthy();
|
|
28
40
|
});
|
|
29
41
|
it('should be rendering icon from iconName prop', function () {
|
|
30
42
|
var _render3 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
iconName: "user"
|
|
44
|
+
}, "TESTE")),
|
|
45
|
+
getByTestId = _render3.getByTestId;
|
|
46
|
+
|
|
34
47
|
expect(getByTestId('icon')).toBeTruthy();
|
|
35
48
|
});
|
|
36
49
|
it('should have class mini', function () {
|
|
37
50
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
iconName: "user",
|
|
52
|
+
size: "mini"
|
|
53
|
+
}, "TESTE")),
|
|
54
|
+
container = _render4.container;
|
|
55
|
+
|
|
42
56
|
expect(container.firstChild).toHaveClass('-mini');
|
|
43
57
|
});
|
|
44
58
|
it('should have class small', function () {
|
|
45
59
|
var _render5 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
iconName: "user",
|
|
61
|
+
size: "small"
|
|
62
|
+
}, "TESTE")),
|
|
63
|
+
container = _render5.container;
|
|
64
|
+
|
|
50
65
|
expect(container.firstChild).toHaveClass('-small');
|
|
51
66
|
});
|
|
52
67
|
it('should have class large', function () {
|
|
53
68
|
var _render6 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
iconName: "user",
|
|
70
|
+
size: "large"
|
|
71
|
+
}, "TESTE")),
|
|
72
|
+
container = _render6.container;
|
|
73
|
+
|
|
58
74
|
expect(container.firstChild).toHaveClass('-large');
|
|
59
75
|
});
|
|
60
76
|
it('should apply customClass', function () {
|
|
61
77
|
var _render7 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
customClass: "customClass"
|
|
79
|
+
}, "TESTE")),
|
|
80
|
+
container = _render7.container;
|
|
81
|
+
|
|
65
82
|
expect(container.firstChild).toHaveClass('customClass');
|
|
66
83
|
});
|
|
67
84
|
it('should apply border', function () {
|
|
68
85
|
var _render8 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
86
|
+
bordered: true
|
|
87
|
+
}, "TESTE")),
|
|
88
|
+
container = _render8.container;
|
|
89
|
+
|
|
72
90
|
expect(container.firstChild).toHaveClass('-bordered');
|
|
73
91
|
});
|
|
74
92
|
it('should apply style prop', function () {
|
|
75
93
|
var _render9 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
style: {
|
|
95
|
+
borderWidth: 10
|
|
96
|
+
}
|
|
97
|
+
}, "TESTE")),
|
|
98
|
+
container = _render9.container;
|
|
99
|
+
|
|
81
100
|
expect(container.firstChild).toHaveStyle('border-width: 10px');
|
|
82
101
|
});
|
|
83
102
|
it('should apply invisible prop', function () {
|
|
84
103
|
var _render10 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
visible: false
|
|
105
|
+
}, "TESTE")),
|
|
106
|
+
container = _render10.container;
|
|
107
|
+
|
|
88
108
|
expect(container.firstChild).not.toBeTruthy();
|
|
89
109
|
});
|
|
90
110
|
it('should apply right icon align', function () {
|
|
91
111
|
var _render11 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
112
|
+
iconName: "user",
|
|
113
|
+
iconAlign: "right"
|
|
114
|
+
}, "TESTE")),
|
|
115
|
+
container = _render11.container;
|
|
116
|
+
|
|
96
117
|
expect(container.firstChild).toHaveClass('icon-right');
|
|
97
118
|
});
|
|
98
119
|
});
|
|
99
120
|
describe('Danger', function () {
|
|
100
121
|
var dangerLabel = /*#__PURE__*/_react.default.createElement(_index.DangerLabel, null, "TESTE");
|
|
122
|
+
|
|
101
123
|
it('should have class -danger', function () {
|
|
102
124
|
var _render12 = (0, _react2.render)(dangerLabel),
|
|
103
|
-
|
|
125
|
+
container = _render12.container;
|
|
126
|
+
|
|
104
127
|
expect(container.firstChild).toHaveClass('-danger');
|
|
105
128
|
});
|
|
106
129
|
});
|
|
107
130
|
describe('Info', function () {
|
|
108
131
|
it('should have class -info', function () {
|
|
109
132
|
var _render13 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.InfoLabel, null, "TESTE")),
|
|
110
|
-
|
|
133
|
+
container = _render13.container;
|
|
134
|
+
|
|
111
135
|
expect(container.firstChild).toHaveClass('-info');
|
|
112
136
|
});
|
|
113
137
|
});
|
|
114
138
|
describe('Primary', function () {
|
|
115
139
|
it('should have class -primary', function () {
|
|
116
140
|
var _render14 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.PrimaryLabel, null, "TESTE")),
|
|
117
|
-
|
|
141
|
+
container = _render14.container;
|
|
142
|
+
|
|
118
143
|
expect(container.firstChild).toHaveClass('-primary');
|
|
119
144
|
});
|
|
120
145
|
});
|
|
121
146
|
describe('Success', function () {
|
|
122
147
|
it('should have class -success', function () {
|
|
123
148
|
var _render15 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.SuccessLabel, null, "TESTE")),
|
|
124
|
-
|
|
149
|
+
container = _render15.container;
|
|
150
|
+
|
|
125
151
|
expect(container.firstChild).toHaveClass('-success');
|
|
126
152
|
});
|
|
127
153
|
});
|
|
128
154
|
describe('Warning', function () {
|
|
129
155
|
it('should have class -warning', function () {
|
|
130
156
|
var _render16 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_index.WarningLabel, null, "TESTE")),
|
|
131
|
-
|
|
157
|
+
container = _render16.container;
|
|
158
|
+
|
|
132
159
|
expect(container.firstChild).toHaveClass('-warning');
|
|
133
160
|
});
|
|
134
161
|
});
|