@pedidopago/ui 1.5.20 → 1.5.21
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/dist/components/Alert/types.d.ts +1 -1
- package/dist/components/Alert/types.d.ts.map +1 -1
- package/dist/components/Avatar/types.d.ts +1 -1
- package/dist/components/Avatar/types.d.ts.map +1 -1
- package/dist/components/Flex/styles.js +1 -1
- package/dist/components/Flex/types.d.ts +1 -1
- package/dist/components/Flex/types.d.ts.map +1 -1
- package/dist/components/IconItem/types.d.ts +1 -1
- package/dist/components/IconItem/types.d.ts.map +1 -1
- package/dist/components/MultipleSelect/types.d.ts +1 -1
- package/dist/components/MultipleSelect/types.d.ts.map +1 -1
- package/dist/components/Pagination/types.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts.map +1 -1
- package/dist/components/Spinner/types.d.ts +1 -1
- package/dist/components/Spinner/types.d.ts.map +1 -1
- package/dist/shared/global.d.ts +2 -0
- package/dist/shared/global.d.ts.map +1 -0
- package/dist/utils/file.d.ts +1 -1
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/formatters/credit-card.d.ts +1 -1
- package/dist/utils/formatters/credit-card.d.ts.map +1 -1
- package/dist/utils/formatters/name.d.ts +1 -1
- package/dist/utils/formatters/name.d.ts.map +1 -1
- package/package.json +7 -4
- package/dist/components/Alert/alert.test.d.ts +0 -2
- package/dist/components/Alert/alert.test.d.ts.map +0 -1
- package/dist/components/Alert/alert.test.js +0 -92
- package/dist/components/Avatar/avatar.test.d.ts +0 -2
- package/dist/components/Avatar/avatar.test.d.ts.map +0 -1
- package/dist/components/Avatar/avatar.test.js +0 -74
- package/dist/components/Badge/badge.test.d.ts +0 -2
- package/dist/components/Badge/badge.test.d.ts.map +0 -1
- package/dist/components/Badge/badge.test.js +0 -82
- package/dist/components/Button/Button.test.d.ts +0 -2
- package/dist/components/Button/Button.test.d.ts.map +0 -1
- package/dist/components/Button/Button.test.js +0 -172
- package/dist/components/Card/card.test.d.ts +0 -2
- package/dist/components/Card/card.test.d.ts.map +0 -1
- package/dist/components/Card/card.test.js +0 -37
- package/dist/components/CheckboxInput/checkbox-input.test.d.ts +0 -2
- package/dist/components/CheckboxInput/checkbox-input.test.d.ts.map +0 -1
- package/dist/components/CheckboxInput/checkbox-input.test.js +0 -194
- package/dist/components/CollapseCard/expand-button.test.d.ts +0 -2
- package/dist/components/CollapseCard/expand-button.test.d.ts.map +0 -1
- package/dist/components/CollapseCard/expand-button.test.js +0 -196
- package/dist/components/ColorPicker/colorpicker.test.d.ts +0 -2
- package/dist/components/ColorPicker/colorpicker.test.d.ts.map +0 -1
- package/dist/components/ColorPicker/colorpicker.test.js +0 -74
- package/dist/components/DateInput/dateInput.test.d.ts +0 -2
- package/dist/components/DateInput/dateInput.test.d.ts.map +0 -1
- package/dist/components/DateInput/dateInput.test.js +0 -52
- package/dist/components/DatePicker/datepicker.test.d.ts +0 -2
- package/dist/components/DatePicker/datepicker.test.d.ts.map +0 -1
- package/dist/components/DatePicker/datepicker.test.js +0 -138
- package/dist/components/Dialog/dialog.test.d.ts +0 -2
- package/dist/components/Dialog/dialog.test.d.ts.map +0 -1
- package/dist/components/Dialog/dialog.test.js +0 -81
- package/dist/components/Dropzone/dropzone.test.d.ts +0 -2
- package/dist/components/Dropzone/dropzone.test.d.ts.map +0 -1
- package/dist/components/Dropzone/dropzone.test.js +0 -79
- package/dist/components/Flex/flex.test.d.ts +0 -2
- package/dist/components/Flex/flex.test.d.ts.map +0 -1
- package/dist/components/Flex/flex.test.js +0 -355
- package/dist/components/Grid/grid.test.d.ts +0 -2
- package/dist/components/Grid/grid.test.d.ts.map +0 -1
- package/dist/components/Grid/grid.test.js +0 -140
- package/dist/components/Icon/icon.test.d.ts +0 -2
- package/dist/components/Icon/icon.test.d.ts.map +0 -1
- package/dist/components/Icon/icon.test.js +0 -70
- package/dist/components/IconItem/IconItem.test.d.ts +0 -2
- package/dist/components/IconItem/IconItem.test.d.ts.map +0 -1
- package/dist/components/IconItem/IconItem.test.js +0 -68
- package/dist/components/Illustration/illustration.test.d.ts +0 -2
- package/dist/components/Illustration/illustration.test.d.ts.map +0 -1
- package/dist/components/Illustration/illustration.test.js +0 -61
- package/dist/components/ImageItem/input.test.d.ts +0 -2
- package/dist/components/ImageItem/input.test.d.ts.map +0 -1
- package/dist/components/ImageItem/input.test.js +0 -101
- package/dist/components/Input/input.test.d.ts +0 -2
- package/dist/components/Input/input.test.d.ts.map +0 -1
- package/dist/components/Input/input.test.js +0 -144
- package/dist/components/Label/label.test.d.ts +0 -2
- package/dist/components/Label/label.test.d.ts.map +0 -1
- package/dist/components/Label/label.test.js +0 -105
- package/dist/components/List/list.test.d.ts +0 -2
- package/dist/components/List/list.test.d.ts.map +0 -1
- package/dist/components/List/list.test.js +0 -71
- package/dist/components/Modal/modal.test.d.ts +0 -2
- package/dist/components/Modal/modal.test.d.ts.map +0 -1
- package/dist/components/Modal/modal.test.js +0 -197
- package/dist/components/MultipleSelect/MultipleSelect.test.d.ts +0 -2
- package/dist/components/MultipleSelect/MultipleSelect.test.d.ts.map +0 -1
- package/dist/components/MultipleSelect/MultipleSelect.test.js +0 -447
- package/dist/components/Pagination/pagination.test.d.ts +0 -2
- package/dist/components/Pagination/pagination.test.d.ts.map +0 -1
- package/dist/components/Pagination/pagination.test.js +0 -152
- package/dist/components/Progress/progress.test.d.ts +0 -2
- package/dist/components/Progress/progress.test.d.ts.map +0 -1
- package/dist/components/Progress/progress.test.js +0 -126
- package/dist/components/RadioInput/radio-input.test.d.ts +0 -2
- package/dist/components/RadioInput/radio-input.test.d.ts.map +0 -1
- package/dist/components/RadioInput/radio-input.test.js +0 -208
- package/dist/components/Rating/rating.test.d.ts +0 -2
- package/dist/components/Rating/rating.test.d.ts.map +0 -1
- package/dist/components/Rating/rating.test.js +0 -79
- package/dist/components/ReactPortal/reactPortal.test.d.ts +0 -2
- package/dist/components/ReactPortal/reactPortal.test.d.ts.map +0 -1
- package/dist/components/ReactPortal/reactPortal.test.js +0 -26
- package/dist/components/Select/select.test.d.ts +0 -2
- package/dist/components/Select/select.test.d.ts.map +0 -1
- package/dist/components/Select/select.test.js +0 -67
- package/dist/components/Skeleton/skeleton.test.d.ts +0 -2
- package/dist/components/Skeleton/skeleton.test.d.ts.map +0 -1
- package/dist/components/Skeleton/skeleton.test.js +0 -106
- package/dist/components/Slider/slider.test.d.ts +0 -2
- package/dist/components/Slider/slider.test.d.ts.map +0 -1
- package/dist/components/Slider/slider.test.js +0 -134
- package/dist/components/Spinner/spinner.test.d.ts +0 -2
- package/dist/components/Spinner/spinner.test.d.ts.map +0 -1
- package/dist/components/Spinner/spinner.test.js +0 -55
- package/dist/components/Steps/steps.test.d.ts +0 -2
- package/dist/components/Steps/steps.test.d.ts.map +0 -1
- package/dist/components/Steps/steps.test.js +0 -63
- package/dist/components/Switch/switch.test.d.ts +0 -2
- package/dist/components/Switch/switch.test.d.ts.map +0 -1
- package/dist/components/Switch/switch.test.js +0 -253
- package/dist/components/Table/table.test.d.ts +0 -2
- package/dist/components/Table/table.test.d.ts.map +0 -1
- package/dist/components/Table/table.test.js +0 -130
- package/dist/components/Tabs/tabs.test.d.ts +0 -2
- package/dist/components/Tabs/tabs.test.d.ts.map +0 -1
- package/dist/components/Tabs/tabs.test.js +0 -159
- package/dist/components/Tag/tag.test.d.ts +0 -2
- package/dist/components/Tag/tag.test.d.ts.map +0 -1
- package/dist/components/Tag/tag.test.js +0 -78
- package/dist/components/TextAreaInput/text-area-input.test.d.ts +0 -2
- package/dist/components/TextAreaInput/text-area-input.test.d.ts.map +0 -1
- package/dist/components/TextAreaInput/text-area-input.test.js +0 -96
- package/dist/components/Thumbnail/thumbnail.test.d.ts +0 -2
- package/dist/components/Thumbnail/thumbnail.test.d.ts.map +0 -1
- package/dist/components/Thumbnail/thumbnail.test.js +0 -82
- package/dist/components/Timeline/timeline.test.d.ts +0 -2
- package/dist/components/Timeline/timeline.test.d.ts.map +0 -1
- package/dist/components/Timeline/timeline.test.js +0 -152
- package/dist/components/Toast/toast.test.d.ts +0 -2
- package/dist/components/Toast/toast.test.d.ts.map +0 -1
- package/dist/components/Toast/toast.test.js +0 -139
- package/dist/components/Typography/typography.test.d.ts +0 -2
- package/dist/components/Typography/typography.test.d.ts.map +0 -1
- package/dist/components/Typography/typography.test.js +0 -325
- package/dist/shared/theme/theme.test.d.ts +0 -2
- package/dist/shared/theme/theme.test.d.ts.map +0 -1
- package/dist/shared/theme/theme.test.js +0 -115
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
|
-
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
|
-
require("@testing-library/jest-dom");
|
|
8
|
-
|
|
9
|
-
var _ = require(".");
|
|
10
|
-
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
|
|
15
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
|
|
17
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
-
|
|
19
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
20
|
-
|
|
21
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
22
|
-
|
|
23
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
|
-
|
|
25
|
-
describe('Pagination', function () {
|
|
26
|
-
it('Should render pagination', function () {
|
|
27
|
-
var numberOfPages = 10;
|
|
28
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
29
|
-
count: numberOfPages
|
|
30
|
-
}));
|
|
31
|
-
expect(_react.screen.getByText('10')).toBeInTheDocument();
|
|
32
|
-
});
|
|
33
|
-
it('Should call change function', function () {
|
|
34
|
-
var fn = jest.fn();
|
|
35
|
-
var numberOfPages = 10;
|
|
36
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
37
|
-
count: numberOfPages,
|
|
38
|
-
onChange: fn
|
|
39
|
-
}));
|
|
40
|
-
|
|
41
|
-
_react.fireEvent.click(_react.screen.getByText('2'));
|
|
42
|
-
|
|
43
|
-
expect(fn).toBeCalled();
|
|
44
|
-
});
|
|
45
|
-
it('Should disable previous button when current page to be 1', function () {
|
|
46
|
-
var numberOfPages = 10;
|
|
47
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
48
|
-
count: numberOfPages
|
|
49
|
-
}));
|
|
50
|
-
|
|
51
|
-
var _screen$getAllByRole = _react.screen.getAllByRole('button'),
|
|
52
|
-
_screen$getAllByRole2 = _slicedToArray(_screen$getAllByRole, 1),
|
|
53
|
-
previousButton = _screen$getAllByRole2[0];
|
|
54
|
-
|
|
55
|
-
expect(previousButton).toBeDisabled();
|
|
56
|
-
});
|
|
57
|
-
it('Should disable next button when current page to be last page', function () {
|
|
58
|
-
var numberOfPages = 10;
|
|
59
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
60
|
-
count: numberOfPages
|
|
61
|
-
}));
|
|
62
|
-
|
|
63
|
-
var buttons = _react.screen.getAllByRole('button');
|
|
64
|
-
|
|
65
|
-
var _buttons$reverse = buttons.reverse(),
|
|
66
|
-
_buttons$reverse2 = _slicedToArray(_buttons$reverse, 1),
|
|
67
|
-
nextButton = _buttons$reverse2[0];
|
|
68
|
-
|
|
69
|
-
_react.fireEvent.click(_react.screen.getByText('10'));
|
|
70
|
-
|
|
71
|
-
expect(nextButton).toBeDisabled();
|
|
72
|
-
});
|
|
73
|
-
it('Should change current page on Click', function () {
|
|
74
|
-
var numberOfPages = 10;
|
|
75
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
76
|
-
count: numberOfPages
|
|
77
|
-
}));
|
|
78
|
-
|
|
79
|
-
var pageButton = _react.screen.getByText('3');
|
|
80
|
-
|
|
81
|
-
_react.fireEvent.click(pageButton);
|
|
82
|
-
|
|
83
|
-
expect(window.getComputedStyle(pageButton).backgroundColor).toBe('rgb(34, 224, 161)');
|
|
84
|
-
});
|
|
85
|
-
it('Should set hightlight color if color prop is provided', function () {
|
|
86
|
-
var numberOfPages = 10;
|
|
87
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
88
|
-
count: numberOfPages,
|
|
89
|
-
color: "#f6ca3f"
|
|
90
|
-
}));
|
|
91
|
-
|
|
92
|
-
var pageButton = _react.screen.getByText('1');
|
|
93
|
-
|
|
94
|
-
expect(window.getComputedStyle(pageButton).backgroundColor).toBe('rgb(246, 202, 63)');
|
|
95
|
-
});
|
|
96
|
-
it('Should set circular button if shape circular is provided', function () {
|
|
97
|
-
var numberOfPages = 10;
|
|
98
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
99
|
-
count: numberOfPages,
|
|
100
|
-
shape: "circular"
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
var _screen$getAllByRole3 = _react.screen.getAllByRole('button'),
|
|
104
|
-
_screen$getAllByRole4 = _slicedToArray(_screen$getAllByRole3, 1),
|
|
105
|
-
navigationButton = _screen$getAllByRole4[0];
|
|
106
|
-
|
|
107
|
-
expect(window.getComputedStyle(navigationButton).borderRadius).toBe('50%');
|
|
108
|
-
});
|
|
109
|
-
it('Should set roundend button if shape rounded is provided', function () {
|
|
110
|
-
var numberOfPages = 10;
|
|
111
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
112
|
-
count: numberOfPages,
|
|
113
|
-
shape: "rounded"
|
|
114
|
-
}));
|
|
115
|
-
|
|
116
|
-
var _screen$getAllByRole5 = _react.screen.getAllByRole('button'),
|
|
117
|
-
_screen$getAllByRole6 = _slicedToArray(_screen$getAllByRole5, 1),
|
|
118
|
-
navigationButton = _screen$getAllByRole6[0];
|
|
119
|
-
|
|
120
|
-
expect(window.getComputedStyle(navigationButton).borderRadius).toBe('8px 0 0 8px');
|
|
121
|
-
});
|
|
122
|
-
it('Should render small pagination if size small is provided', function () {
|
|
123
|
-
var numberOfPages = 10;
|
|
124
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
125
|
-
count: numberOfPages,
|
|
126
|
-
size: "small"
|
|
127
|
-
}));
|
|
128
|
-
expect(_react.screen.getAllByRole('button').length).toBe(2);
|
|
129
|
-
});
|
|
130
|
-
it('Should render default selected page if defaultPage is provided', function () {
|
|
131
|
-
var numberOfPages = 10;
|
|
132
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
133
|
-
count: numberOfPages,
|
|
134
|
-
defaultPage: 5
|
|
135
|
-
}));
|
|
136
|
-
|
|
137
|
-
var pageButton = _react.screen.getByText('5');
|
|
138
|
-
|
|
139
|
-
expect(window.getComputedStyle(pageButton).backgroundColor).toBe('rgb(34, 224, 161)');
|
|
140
|
-
});
|
|
141
|
-
it('Should disabled if isDisabledProp is provided', function () {
|
|
142
|
-
var numberOfPages = 10;
|
|
143
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Pagination, {
|
|
144
|
-
count: numberOfPages,
|
|
145
|
-
isDisabled: true
|
|
146
|
-
}));
|
|
147
|
-
|
|
148
|
-
var pageButton = _react.screen.getByText('10');
|
|
149
|
-
|
|
150
|
-
expect(pageButton).toBeDisabled();
|
|
151
|
-
});
|
|
152
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress.test.d.ts","sourceRoot":"","sources":["../../../src/components/Progress/progress.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
|
-
require("@testing-library/jest-dom");
|
|
6
|
-
|
|
7
|
-
var _ = require(".");
|
|
8
|
-
|
|
9
|
-
var _getSteps = require("./getSteps");
|
|
10
|
-
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
|
|
17
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
-
|
|
19
|
-
var setup = function setup(props) {
|
|
20
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Progress, _objectSpread({}, props)));
|
|
21
|
-
return utils;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
describe('Progress', function () {
|
|
25
|
-
it('Should render the Progress component', function () {
|
|
26
|
-
var _setup = setup({
|
|
27
|
-
percent: 50
|
|
28
|
-
}),
|
|
29
|
-
container = _setup.container;
|
|
30
|
-
|
|
31
|
-
expect(container).toBeInTheDocument();
|
|
32
|
-
});
|
|
33
|
-
it('Should render the Progress with different color', function () {
|
|
34
|
-
var randomColor = function randomColor() {
|
|
35
|
-
var color = Math.floor(Math.random() * 16777215).toString(16);
|
|
36
|
-
return "#".concat(color);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var _setup2 = setup({
|
|
40
|
-
percent: 20,
|
|
41
|
-
color: randomColor()
|
|
42
|
-
}),
|
|
43
|
-
container = _setup2.container;
|
|
44
|
-
|
|
45
|
-
expect(container).toBeInTheDocument();
|
|
46
|
-
});
|
|
47
|
-
it('Should render the Progress with animated bar', function () {
|
|
48
|
-
var _setup3 = setup({
|
|
49
|
-
percent: 80,
|
|
50
|
-
isAnimated: true
|
|
51
|
-
}),
|
|
52
|
-
container = _setup3.container;
|
|
53
|
-
|
|
54
|
-
expect(container).toBeInTheDocument();
|
|
55
|
-
});
|
|
56
|
-
it('Should render the Progress as Progress Bar', function () {
|
|
57
|
-
var _setup4 = setup({
|
|
58
|
-
percent: 20,
|
|
59
|
-
type: 'linear'
|
|
60
|
-
}),
|
|
61
|
-
container = _setup4.container;
|
|
62
|
-
|
|
63
|
-
expect(container).toBeInTheDocument();
|
|
64
|
-
});
|
|
65
|
-
it('Should render the Progress as Progress Bar with different height', function () {
|
|
66
|
-
var _setup5 = setup({
|
|
67
|
-
percent: 10,
|
|
68
|
-
height: 'sm'
|
|
69
|
-
}),
|
|
70
|
-
container = _setup5.container;
|
|
71
|
-
|
|
72
|
-
expect(container).toBeInTheDocument();
|
|
73
|
-
});
|
|
74
|
-
it('Should render the Progress as Progress Circle', function () {
|
|
75
|
-
var _setup6 = setup({
|
|
76
|
-
percent: 10,
|
|
77
|
-
type: 'circle'
|
|
78
|
-
}),
|
|
79
|
-
container = _setup6.container;
|
|
80
|
-
|
|
81
|
-
expect(container).toBeInTheDocument();
|
|
82
|
-
});
|
|
83
|
-
it('Should render the Progress as Progress Circle with different size', function () {
|
|
84
|
-
var _setup7 = setup({
|
|
85
|
-
percent: 10,
|
|
86
|
-
type: 'circle',
|
|
87
|
-
size: 200
|
|
88
|
-
}),
|
|
89
|
-
container = _setup7.container;
|
|
90
|
-
|
|
91
|
-
expect(container).toBeInTheDocument();
|
|
92
|
-
});
|
|
93
|
-
it('Should render the Progress as Progress Circle with different stroke', function () {
|
|
94
|
-
var _setup8 = setup({
|
|
95
|
-
percent: 10,
|
|
96
|
-
type: 'circle',
|
|
97
|
-
stroke: 5
|
|
98
|
-
}),
|
|
99
|
-
container = _setup8.container;
|
|
100
|
-
|
|
101
|
-
expect(container).toBeInTheDocument();
|
|
102
|
-
});
|
|
103
|
-
it('Should render the Progress as Progress Circle with a circleBody', function () {
|
|
104
|
-
var _setup9 = setup({
|
|
105
|
-
percent: 10,
|
|
106
|
-
type: 'circle',
|
|
107
|
-
circleBody: true
|
|
108
|
-
}),
|
|
109
|
-
container = _setup9.container;
|
|
110
|
-
|
|
111
|
-
expect(container).toBeInTheDocument();
|
|
112
|
-
});
|
|
113
|
-
it('Should render the Progress as Progress Circle showing value', function () {
|
|
114
|
-
var _setup10 = setup({
|
|
115
|
-
percent: 10,
|
|
116
|
-
type: 'circle',
|
|
117
|
-
showValue: 'percent'
|
|
118
|
-
}),
|
|
119
|
-
container = _setup10.container;
|
|
120
|
-
|
|
121
|
-
expect(container).toBeInTheDocument();
|
|
122
|
-
});
|
|
123
|
-
it('Shoud return step by percent', function () {
|
|
124
|
-
expect((0, _getSteps.getSteps)(8, 50)).toEqual(4);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"radio-input.test.d.ts","sourceRoot":"","sources":["../../../src/components/RadioInput/radio-input.test.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("@testing-library/jest-dom");
|
|
4
|
-
|
|
5
|
-
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
8
|
-
|
|
9
|
-
var _ChoiceList = _interopRequireDefault(require("./components/ChoiceList"));
|
|
10
|
-
|
|
11
|
-
var _ = _interopRequireDefault(require("."));
|
|
12
|
-
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
describe('Radio Input', function () {
|
|
18
|
-
it('should render input', function () {
|
|
19
|
-
var fn = jest.fn();
|
|
20
|
-
|
|
21
|
-
var _render = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
22
|
-
onChange: fn,
|
|
23
|
-
value: "test",
|
|
24
|
-
id: "test",
|
|
25
|
-
children: "Radio Test"
|
|
26
|
-
})),
|
|
27
|
-
container = _render.container;
|
|
28
|
-
|
|
29
|
-
var radio = container.querySelector('input[type="radio"]');
|
|
30
|
-
expect(radio).toBeInTheDocument();
|
|
31
|
-
});
|
|
32
|
-
it('should check input on Click on input', function () {
|
|
33
|
-
var fn = jest.fn();
|
|
34
|
-
|
|
35
|
-
var _render2 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChoiceList.default, {
|
|
36
|
-
radiosName: "radio",
|
|
37
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
38
|
-
onChange: fn,
|
|
39
|
-
value: "test",
|
|
40
|
-
id: "test",
|
|
41
|
-
children: "Radio Test"
|
|
42
|
-
})
|
|
43
|
-
})),
|
|
44
|
-
container = _render2.container;
|
|
45
|
-
|
|
46
|
-
var radio = container.querySelector('input[type="radio"]');
|
|
47
|
-
|
|
48
|
-
_react.fireEvent.click(radio);
|
|
49
|
-
|
|
50
|
-
expect(radio).toBeChecked();
|
|
51
|
-
});
|
|
52
|
-
it('should check input on Click label', function () {
|
|
53
|
-
var fn = jest.fn();
|
|
54
|
-
|
|
55
|
-
var _render3 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChoiceList.default, {
|
|
56
|
-
radiosName: "radio",
|
|
57
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
58
|
-
onChange: fn,
|
|
59
|
-
value: "test",
|
|
60
|
-
id: "test",
|
|
61
|
-
children: "Radio Test"
|
|
62
|
-
})
|
|
63
|
-
})),
|
|
64
|
-
container = _render3.container,
|
|
65
|
-
getByText = _render3.getByText;
|
|
66
|
-
|
|
67
|
-
var radio = container.querySelector('input[type="radio"]');
|
|
68
|
-
var label = getByText('Radio Test');
|
|
69
|
-
|
|
70
|
-
_react.fireEvent.click(label);
|
|
71
|
-
|
|
72
|
-
expect(radio).toBeChecked();
|
|
73
|
-
});
|
|
74
|
-
it('should checked input if defaultChecked is provided', function () {
|
|
75
|
-
var fn = jest.fn();
|
|
76
|
-
|
|
77
|
-
var _render4 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChoiceList.default, {
|
|
78
|
-
defaultValue: "test",
|
|
79
|
-
radiosName: "radio",
|
|
80
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
81
|
-
onChange: fn,
|
|
82
|
-
value: "test",
|
|
83
|
-
id: "test",
|
|
84
|
-
children: "Radio Test"
|
|
85
|
-
})
|
|
86
|
-
})),
|
|
87
|
-
container = _render4.container;
|
|
88
|
-
|
|
89
|
-
var radio = container.querySelector('input[type="radio"]');
|
|
90
|
-
expect(radio).toBeChecked();
|
|
91
|
-
});
|
|
92
|
-
it('should call onChange on Click input', function () {
|
|
93
|
-
var fn = jest.fn();
|
|
94
|
-
|
|
95
|
-
var _render5 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChoiceList.default, {
|
|
96
|
-
onChangeValue: fn,
|
|
97
|
-
radiosName: "radio",
|
|
98
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
99
|
-
value: "test",
|
|
100
|
-
id: "test",
|
|
101
|
-
children: "Radio Test"
|
|
102
|
-
})
|
|
103
|
-
})),
|
|
104
|
-
container = _render5.container;
|
|
105
|
-
|
|
106
|
-
_react.fireEvent.click(container);
|
|
107
|
-
|
|
108
|
-
expect(fn).toBeCalled();
|
|
109
|
-
});
|
|
110
|
-
it('Should ChoiceList disabled radio children is isDisabled is provided', function () {
|
|
111
|
-
var fn = jest.fn();
|
|
112
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChoiceList.default, {
|
|
113
|
-
onChangeValue: fn,
|
|
114
|
-
isDisabled: true,
|
|
115
|
-
radiosName: "test-name",
|
|
116
|
-
defaultValue: "test3",
|
|
117
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
118
|
-
value: "test1",
|
|
119
|
-
id: "test",
|
|
120
|
-
children: "Radio Test 1"
|
|
121
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
122
|
-
value: "test2",
|
|
123
|
-
id: "test",
|
|
124
|
-
children: "Radio Test 2"
|
|
125
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
126
|
-
value: "test3",
|
|
127
|
-
id: "test",
|
|
128
|
-
children: "Radio Test 3"
|
|
129
|
-
})]
|
|
130
|
-
}));
|
|
131
|
-
|
|
132
|
-
var sut = _react.screen.getAllByRole('radio');
|
|
133
|
-
|
|
134
|
-
sut.forEach(function (value) {
|
|
135
|
-
expect(value).toBeDisabled();
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
it('should render helpText if helpText is provided', function () {
|
|
139
|
-
var fn = jest.fn();
|
|
140
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChoiceList.default, {
|
|
141
|
-
onChangeValue: fn,
|
|
142
|
-
radiosName: "test-name",
|
|
143
|
-
defaultValue: "test3",
|
|
144
|
-
helpText: "Help Text",
|
|
145
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
146
|
-
value: "test1",
|
|
147
|
-
id: "test",
|
|
148
|
-
children: "Radio Test 1"
|
|
149
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
150
|
-
value: "test2",
|
|
151
|
-
id: "test",
|
|
152
|
-
children: "Radio Test 2"
|
|
153
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
154
|
-
value: "test3",
|
|
155
|
-
id: "test",
|
|
156
|
-
children: "Radio Test 3"
|
|
157
|
-
})]
|
|
158
|
-
}));
|
|
159
|
-
expect(_react.screen.getByText('Help Text')).toBeInTheDocument();
|
|
160
|
-
});
|
|
161
|
-
it('should render label if label is provided', function () {
|
|
162
|
-
var fn = jest.fn();
|
|
163
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChoiceList.default, {
|
|
164
|
-
onChangeValue: fn,
|
|
165
|
-
label: "any_label",
|
|
166
|
-
radiosName: "test-name",
|
|
167
|
-
defaultValue: "test3",
|
|
168
|
-
helpText: "Help Text",
|
|
169
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
170
|
-
value: "test1",
|
|
171
|
-
id: "test",
|
|
172
|
-
children: "Radio Test 1"
|
|
173
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
174
|
-
value: "test2",
|
|
175
|
-
id: "test",
|
|
176
|
-
children: "Radio Test 2"
|
|
177
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
178
|
-
value: "test3",
|
|
179
|
-
id: "test",
|
|
180
|
-
children: "Radio Test 3"
|
|
181
|
-
})]
|
|
182
|
-
}));
|
|
183
|
-
expect(_react.screen.getByRole('radiogroup').children[1].tagName.toLowerCase()).toBe('label');
|
|
184
|
-
});
|
|
185
|
-
it('should not render label if label not provided', function () {
|
|
186
|
-
var fn = jest.fn();
|
|
187
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChoiceList.default, {
|
|
188
|
-
onChangeValue: fn,
|
|
189
|
-
radiosName: "test-name",
|
|
190
|
-
defaultValue: "test3",
|
|
191
|
-
helpText: "Help Text",
|
|
192
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
193
|
-
value: "test1",
|
|
194
|
-
id: "test",
|
|
195
|
-
children: "Radio Test 1"
|
|
196
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
197
|
-
value: "test2",
|
|
198
|
-
id: "test",
|
|
199
|
-
children: "Radio Test 2"
|
|
200
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
201
|
-
value: "test3",
|
|
202
|
-
id: "test",
|
|
203
|
-
children: "Radio Test 3"
|
|
204
|
-
})]
|
|
205
|
-
}));
|
|
206
|
-
expect(_react.screen.getByRole('radiogroup').children[1].tagName.toLowerCase()).not.toBe('label');
|
|
207
|
-
});
|
|
208
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rating.test.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/rating.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _index = require("./index");
|
|
4
|
-
|
|
5
|
-
require("@testing-library/jest-dom");
|
|
6
|
-
|
|
7
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
8
|
-
|
|
9
|
-
var _react = require("@testing-library/react");
|
|
10
|
-
|
|
11
|
-
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
12
|
-
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
describe('Rating', function () {
|
|
18
|
-
it('should be rendered', function () {
|
|
19
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Rating, {}));
|
|
20
|
-
expect(_react.screen.getAllByRole('button')[4]).toBeInTheDocument();
|
|
21
|
-
});
|
|
22
|
-
it('should be call onChange when onChange prop is provided', function () {
|
|
23
|
-
var onChange = jest.fn();
|
|
24
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Rating, {
|
|
25
|
-
value: 5,
|
|
26
|
-
onChange: onChange
|
|
27
|
-
}));
|
|
28
|
-
|
|
29
|
-
_userEvent.default.click(_react.screen.getAllByRole('button')[4]);
|
|
30
|
-
|
|
31
|
-
expect(onChange).toHaveBeenCalled();
|
|
32
|
-
});
|
|
33
|
-
it('should be able to render any quantity of icons ', function () {
|
|
34
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Rating, {
|
|
35
|
-
value: 4,
|
|
36
|
-
quantity: 7
|
|
37
|
-
}));
|
|
38
|
-
expect(_react.screen.getAllByRole('button')[6]).toBeInTheDocument();
|
|
39
|
-
});
|
|
40
|
-
it('should be able to fill svg if hover', function () {
|
|
41
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Rating, {}));
|
|
42
|
-
|
|
43
|
-
var RatingIcon = _react.screen.getAllByRole('button')[4];
|
|
44
|
-
|
|
45
|
-
_react.fireEvent.mouseMove(RatingIcon);
|
|
46
|
-
|
|
47
|
-
expect(RatingIcon === null || RatingIcon === void 0 ? void 0 : RatingIcon.style.fill).not.toBe('none');
|
|
48
|
-
});
|
|
49
|
-
it('should be able to change precision', function () {
|
|
50
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Rating, {
|
|
51
|
-
value: 4.5,
|
|
52
|
-
precision: 0.5
|
|
53
|
-
}));
|
|
54
|
-
expect(_react.screen.getAllByRole('button')[4]).toBeInTheDocument();
|
|
55
|
-
});
|
|
56
|
-
it('should be able to change color', function () {
|
|
57
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Rating, {
|
|
58
|
-
value: 5,
|
|
59
|
-
colorFilledIcon: "neutral.neutral5"
|
|
60
|
-
}));
|
|
61
|
-
|
|
62
|
-
var RatingIcon = _react.screen.getAllByRole('button')[0];
|
|
63
|
-
|
|
64
|
-
expect(RatingIcon.firstChild).toHaveStyle('fill: #587169;');
|
|
65
|
-
});
|
|
66
|
-
it('should be able to change size 40px', function () {
|
|
67
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Rating, {
|
|
68
|
-
value: 5,
|
|
69
|
-
size: "40px"
|
|
70
|
-
}));
|
|
71
|
-
|
|
72
|
-
var RatingIcons = _react.screen.getAllByRole('button')[0];
|
|
73
|
-
|
|
74
|
-
expect(RatingIcons.firstChild).toHaveStyle({
|
|
75
|
-
width: 40,
|
|
76
|
-
height: 40
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactPortal.test.d.ts","sourceRoot":"","sources":["../../../src/components/ReactPortal/reactPortal.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
|
-
var _ = require(".");
|
|
6
|
-
|
|
7
|
-
require("@testing-library/jest-dom");
|
|
8
|
-
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
|
|
11
|
-
function setup() {
|
|
12
|
-
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ReactPortal, {
|
|
13
|
-
wrapperId: "portal-test",
|
|
14
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
15
|
-
children: "Teste"
|
|
16
|
-
})
|
|
17
|
-
}));
|
|
18
|
-
return document.body.querySelector('#portal-test');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
describe('ReactPortal test', function () {
|
|
22
|
-
it('Should render a div inside body', function () {
|
|
23
|
-
var divPortal = setup();
|
|
24
|
-
expect(divPortal).toBeInTheDocument();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.test.d.ts","sourceRoot":"","sources":["../../../src/components/Select/select.test.tsx"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAC"}
|