@pedidopago/ui 1.5.21 → 1.5.23
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/alert.test.d.ts +2 -0
- package/dist/components/Alert/alert.test.d.ts.map +1 -0
- package/dist/components/Alert/alert.test.js +92 -0
- package/dist/components/Alert/types.d.ts +1 -1
- package/dist/components/Alert/types.d.ts.map +1 -1
- package/dist/components/Avatar/avatar.test.d.ts +2 -0
- package/dist/components/Avatar/avatar.test.d.ts.map +1 -0
- package/dist/components/Avatar/avatar.test.js +74 -0
- package/dist/components/Avatar/types.d.ts +1 -1
- package/dist/components/Avatar/types.d.ts.map +1 -1
- package/dist/components/Badge/badge.test.d.ts +2 -0
- package/dist/components/Badge/badge.test.d.ts.map +1 -0
- package/dist/components/Badge/badge.test.js +82 -0
- package/dist/components/Button/Button.test.d.ts +2 -0
- package/dist/components/Button/Button.test.d.ts.map +1 -0
- package/dist/components/Button/Button.test.js +172 -0
- package/dist/components/Card/card.test.d.ts +2 -0
- package/dist/components/Card/card.test.d.ts.map +1 -0
- package/dist/components/Card/card.test.js +37 -0
- package/dist/components/CheckboxInput/checkbox-input.test.d.ts +2 -0
- package/dist/components/CheckboxInput/checkbox-input.test.d.ts.map +1 -0
- package/dist/components/CheckboxInput/checkbox-input.test.js +194 -0
- package/dist/components/CollapseCard/expand-button.test.d.ts +2 -0
- package/dist/components/CollapseCard/expand-button.test.d.ts.map +1 -0
- package/dist/components/CollapseCard/expand-button.test.js +196 -0
- package/dist/components/ColorPicker/colorpicker.test.d.ts +2 -0
- package/dist/components/ColorPicker/colorpicker.test.d.ts.map +1 -0
- package/dist/components/ColorPicker/colorpicker.test.js +74 -0
- package/dist/components/DateInput/dateInput.test.d.ts +2 -0
- package/dist/components/DateInput/dateInput.test.d.ts.map +1 -0
- package/dist/components/DateInput/dateInput.test.js +52 -0
- package/dist/components/DatePicker/datepicker.test.d.ts +2 -0
- package/dist/components/DatePicker/datepicker.test.d.ts.map +1 -0
- package/dist/components/DatePicker/datepicker.test.js +138 -0
- package/dist/components/Dialog/dialog.test.d.ts +2 -0
- package/dist/components/Dialog/dialog.test.d.ts.map +1 -0
- package/dist/components/Dialog/dialog.test.js +81 -0
- package/dist/components/Dropzone/dropzone.test.d.ts +2 -0
- package/dist/components/Dropzone/dropzone.test.d.ts.map +1 -0
- package/dist/components/Dropzone/dropzone.test.js +79 -0
- package/dist/components/Flex/flex.test.d.ts +2 -0
- package/dist/components/Flex/flex.test.d.ts.map +1 -0
- package/dist/components/Flex/flex.test.js +355 -0
- 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/Grid/grid.test.d.ts +2 -0
- package/dist/components/Grid/grid.test.d.ts.map +1 -0
- package/dist/components/Grid/grid.test.js +140 -0
- package/dist/components/Icon/data/dash.js +1 -1
- package/dist/components/Icon/icon.test.d.ts +2 -0
- package/dist/components/Icon/icon.test.d.ts.map +1 -0
- package/dist/components/Icon/icon.test.js +70 -0
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/Icon/types.d.ts.map +1 -1
- package/dist/components/Icon/utils/iconExists.d.ts +5 -0
- package/dist/components/Icon/utils/iconExists.d.ts.map +1 -0
- package/dist/components/Icon/utils/iconExists.js +16 -0
- package/dist/components/IconItem/IconItem.test.d.ts +2 -0
- package/dist/components/IconItem/IconItem.test.d.ts.map +1 -0
- package/dist/components/IconItem/IconItem.test.js +68 -0
- package/dist/components/IconItem/types.d.ts +1 -1
- package/dist/components/IconItem/types.d.ts.map +1 -1
- package/dist/components/Illustration/illustration.test.d.ts +2 -0
- package/dist/components/Illustration/illustration.test.d.ts.map +1 -0
- package/dist/components/Illustration/illustration.test.js +61 -0
- package/dist/components/ImageItem/input.test.d.ts +2 -0
- package/dist/components/ImageItem/input.test.d.ts.map +1 -0
- package/dist/components/ImageItem/input.test.js +101 -0
- package/dist/components/Input/input.test.d.ts +2 -0
- package/dist/components/Input/input.test.d.ts.map +1 -0
- package/dist/components/Input/input.test.js +144 -0
- package/dist/components/Label/label.test.d.ts +2 -0
- package/dist/components/Label/label.test.d.ts.map +1 -0
- package/dist/components/Label/label.test.js +105 -0
- package/dist/components/List/list.test.d.ts +2 -0
- package/dist/components/List/list.test.d.ts.map +1 -0
- package/dist/components/List/list.test.js +71 -0
- package/dist/components/List/types.d.ts +1 -0
- package/dist/components/List/types.d.ts.map +1 -1
- package/dist/components/Modal/modal.test.d.ts +2 -0
- package/dist/components/Modal/modal.test.d.ts.map +1 -0
- package/dist/components/Modal/modal.test.js +197 -0
- package/dist/components/MultipleSelect/MultipleSelect.test.d.ts +2 -0
- package/dist/components/MultipleSelect/MultipleSelect.test.d.ts.map +1 -0
- package/dist/components/MultipleSelect/MultipleSelect.test.js +447 -0
- package/dist/components/MultipleSelect/types.d.ts +1 -1
- package/dist/components/MultipleSelect/types.d.ts.map +1 -1
- package/dist/components/Pagination/pagination.test.d.ts +2 -0
- package/dist/components/Pagination/pagination.test.d.ts.map +1 -0
- package/dist/components/Pagination/pagination.test.js +152 -0
- package/dist/components/Pagination/types.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts.map +1 -1
- package/dist/components/Progress/progress.test.d.ts +2 -0
- package/dist/components/Progress/progress.test.d.ts.map +1 -0
- package/dist/components/Progress/progress.test.js +126 -0
- package/dist/components/RadioInput/radio-input.test.d.ts +2 -0
- package/dist/components/RadioInput/radio-input.test.d.ts.map +1 -0
- package/dist/components/RadioInput/radio-input.test.js +208 -0
- package/dist/components/Rating/rating.test.d.ts +2 -0
- package/dist/components/Rating/rating.test.d.ts.map +1 -0
- package/dist/components/Rating/rating.test.js +79 -0
- package/dist/components/ReactPortal/reactPortal.test.d.ts +2 -0
- package/dist/components/ReactPortal/reactPortal.test.d.ts.map +1 -0
- package/dist/components/ReactPortal/reactPortal.test.js +26 -0
- package/dist/components/Select/components/OptionsSelect/styles.d.ts +2 -253
- package/dist/components/Select/components/OptionsSelect/styles.d.ts.map +1 -1
- package/dist/components/Select/components/OptionsSelect/styles.js +2 -3
- package/dist/components/Select/select.test.d.ts +2 -0
- package/dist/components/Select/select.test.d.ts.map +1 -0
- package/dist/components/Select/select.test.js +67 -0
- package/dist/components/Skeleton/skeleton.test.d.ts +2 -0
- package/dist/components/Skeleton/skeleton.test.d.ts.map +1 -0
- package/dist/components/Skeleton/skeleton.test.js +106 -0
- package/dist/components/Slider/slider.test.d.ts +2 -0
- package/dist/components/Slider/slider.test.d.ts.map +1 -0
- package/dist/components/Slider/slider.test.js +134 -0
- package/dist/components/Spinner/spinner.test.d.ts +2 -0
- package/dist/components/Spinner/spinner.test.d.ts.map +1 -0
- package/dist/components/Spinner/spinner.test.js +55 -0
- package/dist/components/Spinner/types.d.ts +1 -1
- package/dist/components/Spinner/types.d.ts.map +1 -1
- package/dist/components/Steps/steps.test.d.ts +2 -0
- package/dist/components/Steps/steps.test.d.ts.map +1 -0
- package/dist/components/Steps/steps.test.js +63 -0
- package/dist/components/Switch/switch.test.d.ts +2 -0
- package/dist/components/Switch/switch.test.d.ts.map +1 -0
- package/dist/components/Switch/switch.test.js +253 -0
- package/dist/components/Table/components/TableSkeleton.d.ts +4 -0
- package/dist/components/Table/components/TableSkeleton.d.ts.map +1 -0
- package/dist/components/Table/components/TableSkeleton.js +45 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +14 -2
- package/dist/components/Table/table.test.d.ts +2 -0
- package/dist/components/Table/table.test.d.ts.map +1 -0
- package/dist/components/Table/table.test.js +130 -0
- package/dist/components/Table/types.d.ts +14 -0
- package/dist/components/Table/types.d.ts.map +1 -1
- package/dist/components/Tabs/tabs.test.d.ts +2 -0
- package/dist/components/Tabs/tabs.test.d.ts.map +1 -0
- package/dist/components/Tabs/tabs.test.js +159 -0
- package/dist/components/Tag/tag.test.d.ts +2 -0
- package/dist/components/Tag/tag.test.d.ts.map +1 -0
- package/dist/components/Tag/tag.test.js +78 -0
- package/dist/components/TextAreaInput/text-area-input.test.d.ts +2 -0
- package/dist/components/TextAreaInput/text-area-input.test.d.ts.map +1 -0
- package/dist/components/TextAreaInput/text-area-input.test.js +96 -0
- package/dist/components/Thumbnail/thumbnail.test.d.ts +2 -0
- package/dist/components/Thumbnail/thumbnail.test.d.ts.map +1 -0
- package/dist/components/Thumbnail/thumbnail.test.js +82 -0
- package/dist/components/Timeline/timeline.test.d.ts +2 -0
- package/dist/components/Timeline/timeline.test.d.ts.map +1 -0
- package/dist/components/Timeline/timeline.test.js +152 -0
- package/dist/components/Toast/contexts/ToastProvider.d.ts +4 -4
- package/dist/components/Toast/contexts/ToastProvider.d.ts.map +1 -1
- package/dist/components/Toast/toast.test.d.ts +2 -0
- package/dist/components/Toast/toast.test.d.ts.map +1 -0
- package/dist/components/Toast/toast.test.js +139 -0
- package/dist/components/Toast/types.d.ts +4 -1
- package/dist/components/Toast/types.d.ts.map +1 -1
- package/dist/components/Typography/typography.test.d.ts +2 -0
- package/dist/components/Typography/typography.test.d.ts.map +1 -0
- package/dist/components/Typography/typography.test.js +325 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/shared/tests/test-utils.d.ts.map +1 -1
- package/dist/shared/tests/types.d.ts +5 -0
- package/dist/shared/tests/types.d.ts.map +1 -0
- package/dist/shared/tests/types.js +1 -0
- package/dist/shared/theme/theme.test.d.ts +2 -0
- package/dist/shared/theme/theme.test.d.ts.map +1 -0
- package/dist/shared/theme/theme.test.js +116 -0
- package/package.json +6 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.test.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/alert.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
+
|
|
5
|
+
require("@testing-library/jest-dom");
|
|
6
|
+
|
|
7
|
+
var _ = _interopRequireDefault(require("."));
|
|
8
|
+
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
return (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
describe('Alert', function () {
|
|
24
|
+
it('should it render the alert component', function () {
|
|
25
|
+
var container = setup({
|
|
26
|
+
content: 'test',
|
|
27
|
+
title: 'Test Toast'
|
|
28
|
+
});
|
|
29
|
+
expect(container.getByText('test')).toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
it('should it render the alert component in outlined variant', function () {
|
|
32
|
+
var container = setup({
|
|
33
|
+
content: 'test',
|
|
34
|
+
title: 'Test Toast',
|
|
35
|
+
variant: 'outlined'
|
|
36
|
+
});
|
|
37
|
+
expect(container.getByText('test')).toBeInTheDocument();
|
|
38
|
+
});
|
|
39
|
+
it('should it render the alert component in closable variant', function () {
|
|
40
|
+
var container = setup({
|
|
41
|
+
content: 'test',
|
|
42
|
+
title: 'Test Toast',
|
|
43
|
+
variant: 'closable'
|
|
44
|
+
});
|
|
45
|
+
expect(container.getByText('test')).toBeInTheDocument();
|
|
46
|
+
});
|
|
47
|
+
it('should it render the alert component in success type', function () {
|
|
48
|
+
var container = setup({
|
|
49
|
+
content: 'test',
|
|
50
|
+
title: 'Test Toast',
|
|
51
|
+
type: 'success'
|
|
52
|
+
});
|
|
53
|
+
expect(container.getByText('test')).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
it('should it render the alert component in error type', function () {
|
|
56
|
+
var container = setup({
|
|
57
|
+
content: 'test',
|
|
58
|
+
title: 'Test Toast',
|
|
59
|
+
type: 'error'
|
|
60
|
+
});
|
|
61
|
+
expect(container.getByText('test')).toBeInTheDocument();
|
|
62
|
+
});
|
|
63
|
+
it('should it render the alert component in warning type', function () {
|
|
64
|
+
var container = setup({
|
|
65
|
+
content: 'test',
|
|
66
|
+
title: 'Test Toast',
|
|
67
|
+
type: 'warning'
|
|
68
|
+
});
|
|
69
|
+
expect(container.getByText('test')).toBeInTheDocument();
|
|
70
|
+
});
|
|
71
|
+
it('should it render the alert component in critical type', function () {
|
|
72
|
+
var container = setup({
|
|
73
|
+
content: 'test',
|
|
74
|
+
title: 'Test Toast',
|
|
75
|
+
type: 'critical'
|
|
76
|
+
});
|
|
77
|
+
expect(container.getByText('test')).toBeInTheDocument();
|
|
78
|
+
});
|
|
79
|
+
it('should it call the callback provided in onClose prop', function () {
|
|
80
|
+
var _container$baseElemen;
|
|
81
|
+
|
|
82
|
+
var onClose = jest.fn();
|
|
83
|
+
var container = setup({
|
|
84
|
+
content: 'test',
|
|
85
|
+
title: 'Test Toast',
|
|
86
|
+
variant: 'closable',
|
|
87
|
+
onClose: onClose
|
|
88
|
+
});
|
|
89
|
+
(_container$baseElemen = container.baseElement.querySelectorAll('svg')[1].parentElement) === null || _container$baseElemen === void 0 ? void 0 : _container$baseElemen.click();
|
|
90
|
+
expect(onClose).toHaveBeenCalled();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,oBAAY,UAAU,GAAG;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;IAChF;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;IAChF,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.test.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/avatar.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
+
|
|
5
|
+
require("@testing-library/jest-dom");
|
|
6
|
+
|
|
7
|
+
var _ = _interopRequireDefault(require("."));
|
|
8
|
+
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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)(_.default, _objectSpread({}, props)));
|
|
21
|
+
return utils;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
describe('Avatar', function () {
|
|
25
|
+
it('should it render the avatar component', function () {
|
|
26
|
+
var avatar = setup({
|
|
27
|
+
name: 'John Doe',
|
|
28
|
+
src: 'https://avatars2.githubusercontent.com/u/1234?s=460&v=4'
|
|
29
|
+
});
|
|
30
|
+
expect(avatar.container).toBeInTheDocument();
|
|
31
|
+
});
|
|
32
|
+
it('should it render the avatar component with a image', function () {
|
|
33
|
+
var _avatar$container$que;
|
|
34
|
+
|
|
35
|
+
var avatar = setup({
|
|
36
|
+
name: 'John Doe',
|
|
37
|
+
src: 'https://avatars2.githubusercontent.com/u/1234?s=460&v=4'
|
|
38
|
+
});
|
|
39
|
+
expect((_avatar$container$que = avatar.container.querySelector('img')) === null || _avatar$container$que === void 0 ? void 0 : _avatar$container$que.getAttribute('src')).toEqual('https://avatars2.githubusercontent.com/u/1234?s=460&v=4');
|
|
40
|
+
});
|
|
41
|
+
it('should it render the avatar component with a name and an information', function () {
|
|
42
|
+
var avatar = setup({
|
|
43
|
+
name: 'John Doe',
|
|
44
|
+
information: 'The user information'
|
|
45
|
+
});
|
|
46
|
+
expect(avatar.getByText('John Doe')).toBeInTheDocument();
|
|
47
|
+
expect(avatar.getByText('The user information')).toBeInTheDocument();
|
|
48
|
+
});
|
|
49
|
+
it('should it render the avatar component with a name, information and image', function () {
|
|
50
|
+
var avatar = setup({
|
|
51
|
+
name: 'John Doe',
|
|
52
|
+
information: 'The user information',
|
|
53
|
+
src: 'https://avatars2.githubusercontent.com/u/1234?s=460&v=4'
|
|
54
|
+
});
|
|
55
|
+
expect(avatar.getByText('John Doe')).toBeInTheDocument();
|
|
56
|
+
expect(avatar.getByText('The user information')).toBeInTheDocument();
|
|
57
|
+
expect(avatar.container.querySelector('img')).toBeInTheDocument();
|
|
58
|
+
});
|
|
59
|
+
it('should it render the avatar component with avatar name initials', function () {
|
|
60
|
+
var avatar = setup({
|
|
61
|
+
name: 'John Doe'
|
|
62
|
+
});
|
|
63
|
+
expect(avatar.getByText('JD')).toBeInTheDocument();
|
|
64
|
+
});
|
|
65
|
+
it('should it render the avatar component with avatar name initials if the image source is broken', function () {
|
|
66
|
+
var avatar = setup({
|
|
67
|
+
name: 'John Doe',
|
|
68
|
+
src: 'https://broken.link/'
|
|
69
|
+
});
|
|
70
|
+
setTimeout(function () {
|
|
71
|
+
expect(avatar.getByText('JD')).toBeInTheDocument();
|
|
72
|
+
}, 1000);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC;AAE1D,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC7C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAE7C,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;KACpC,GAAG,gBAAgB,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.test.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/badge.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
+
|
|
5
|
+
require("@testing-library/jest-dom");
|
|
6
|
+
|
|
7
|
+
var _ = _interopRequireDefault(require("."));
|
|
8
|
+
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
11
|
+
var _excluded = ["children"];
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
22
|
+
|
|
23
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
24
|
+
|
|
25
|
+
var setup = function setup(_ref) {
|
|
26
|
+
var children = _ref.children,
|
|
27
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
|
|
29
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread(_objectSpread({}, props), {}, {
|
|
30
|
+
children: children
|
|
31
|
+
})));
|
|
32
|
+
return utils;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
describe('Badge', function () {
|
|
36
|
+
it('should it render the badge component', function () {
|
|
37
|
+
var utils = setup({
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
39
|
+
children: "Teste badge"
|
|
40
|
+
}),
|
|
41
|
+
type: 'primary'
|
|
42
|
+
});
|
|
43
|
+
expect(utils.container).toBeInTheDocument();
|
|
44
|
+
});
|
|
45
|
+
it('should it render the badge component in loading state', function () {
|
|
46
|
+
var utils = setup({
|
|
47
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
48
|
+
children: "Teste badge"
|
|
49
|
+
}),
|
|
50
|
+
type: 'primary',
|
|
51
|
+
isLoading: true
|
|
52
|
+
});
|
|
53
|
+
expect(utils.container).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
it('should it render multiply badges', function () {
|
|
56
|
+
var utils = function utils(type) {
|
|
57
|
+
return setup({
|
|
58
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
59
|
+
children: "Teste badge"
|
|
60
|
+
}),
|
|
61
|
+
type: type,
|
|
62
|
+
isLoading: true
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
expect(utils({
|
|
67
|
+
type: 'primary'
|
|
68
|
+
}).container).toBeInTheDocument();
|
|
69
|
+
expect(utils({
|
|
70
|
+
type: 'secondary'
|
|
71
|
+
}).container).toBeInTheDocument();
|
|
72
|
+
expect(utils({
|
|
73
|
+
type: 'informative'
|
|
74
|
+
}).container).toBeInTheDocument();
|
|
75
|
+
expect(utils({
|
|
76
|
+
type: 'warning'
|
|
77
|
+
}).container).toBeInTheDocument();
|
|
78
|
+
expect(utils({
|
|
79
|
+
type: 'error'
|
|
80
|
+
}).container).toBeInTheDocument();
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.test.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.test.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
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 _ = _interopRequireDefault(require("."));
|
|
10
|
+
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
describe('Button', function () {
|
|
22
|
+
var setup = function setup(props) {
|
|
23
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread(_objectSpread({}, props), {}, {
|
|
24
|
+
children: "Button test"
|
|
25
|
+
})));
|
|
26
|
+
|
|
27
|
+
var getSkeleton = function getSkeleton() {
|
|
28
|
+
return utils.getAllByTestId('skeleton')[0];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var getLeftIcon = function getLeftIcon() {
|
|
32
|
+
return utils.getAllByTestId('leftIconId')[0];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var getRightIcon = function getRightIcon() {
|
|
36
|
+
return utils.getAllByTestId('rightIconId')[0];
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return _objectSpread({
|
|
40
|
+
getSkeleton: getSkeleton,
|
|
41
|
+
getLeftIcon: getLeftIcon,
|
|
42
|
+
getRightIcon: getRightIcon
|
|
43
|
+
}, utils);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
it('should be rendered', function () {
|
|
47
|
+
var _setup = setup({
|
|
48
|
+
bgColor: '#fff',
|
|
49
|
+
variant: 'solid'
|
|
50
|
+
}),
|
|
51
|
+
container = _setup.container;
|
|
52
|
+
|
|
53
|
+
expect(container).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
it('should call onClick function when clicked', function () {
|
|
56
|
+
var handleClick = jest.fn();
|
|
57
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
58
|
+
variant: "solid",
|
|
59
|
+
bgColor: "#fff",
|
|
60
|
+
onClick: handleClick,
|
|
61
|
+
children: "Click Me"
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
_react.fireEvent.click(_react.screen.getByRole('button'));
|
|
65
|
+
|
|
66
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
67
|
+
});
|
|
68
|
+
it('should render a disabled button', function () {
|
|
69
|
+
var handleClick = jest.fn();
|
|
70
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
71
|
+
disabled: true,
|
|
72
|
+
variant: "solid",
|
|
73
|
+
bgColor: "#fff",
|
|
74
|
+
onClick: handleClick,
|
|
75
|
+
children: "Click Me"
|
|
76
|
+
}));
|
|
77
|
+
expect(_react.screen.getByRole('button')).toBeDisabled();
|
|
78
|
+
expect(_react.screen.getByRole('button')).not.toHaveStyle('cursor: pointer');
|
|
79
|
+
});
|
|
80
|
+
it('should render a ghost variant button', function () {
|
|
81
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
82
|
+
variant: "ghost",
|
|
83
|
+
children: "Click Me"
|
|
84
|
+
}));
|
|
85
|
+
expect(_react.screen.getByRole('button')).toHaveStyle('background-color: transparent');
|
|
86
|
+
});
|
|
87
|
+
it('should render a link variant button', function () {
|
|
88
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
89
|
+
variant: "link",
|
|
90
|
+
children: "Click Me"
|
|
91
|
+
}));
|
|
92
|
+
expect(_react.screen.getByRole('button')).toHaveStyle('background-color: transparent');
|
|
93
|
+
expect(_react.screen.getByRole('button')).toHaveStyle('text-decoration: underline');
|
|
94
|
+
});
|
|
95
|
+
it('should render an outline variant button', function () {
|
|
96
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
97
|
+
variant: "outline",
|
|
98
|
+
textColor: "#ff00ff",
|
|
99
|
+
children: "Click Me"
|
|
100
|
+
}));
|
|
101
|
+
expect(_react.screen.getByRole('button')).toHaveStyle('background-color: transparent');
|
|
102
|
+
expect(_react.screen.getByRole('button')).toHaveStyle('color: #ff00ff');
|
|
103
|
+
});
|
|
104
|
+
it('should render a button that takes full width (boolean)', function () {
|
|
105
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
106
|
+
fullWidth: true,
|
|
107
|
+
variant: "solid",
|
|
108
|
+
children: "Click Me"
|
|
109
|
+
}));
|
|
110
|
+
expect(_react.screen.getByRole('button')).toHaveStyle('width: 100%');
|
|
111
|
+
});
|
|
112
|
+
it('should render a button that takes full width (Responsive Object)', function () {
|
|
113
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
114
|
+
fullWidth: {
|
|
115
|
+
base: true
|
|
116
|
+
},
|
|
117
|
+
variant: "solid",
|
|
118
|
+
bgColor: "#fff",
|
|
119
|
+
children: "Click Me"
|
|
120
|
+
}));
|
|
121
|
+
expect(_react.screen.getByRole('button')).toHaveStyle('width: 100%');
|
|
122
|
+
});
|
|
123
|
+
it('should not render a button that takes full width (Responsive Object)', function () {
|
|
124
|
+
var handleClick = jest.fn();
|
|
125
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
126
|
+
fullWidth: {
|
|
127
|
+
base: false,
|
|
128
|
+
sm: true
|
|
129
|
+
},
|
|
130
|
+
variant: "solid",
|
|
131
|
+
bgColor: "#fff",
|
|
132
|
+
onClick: handleClick,
|
|
133
|
+
children: "Click Me"
|
|
134
|
+
}));
|
|
135
|
+
expect(_react.screen.getByRole('button')).not.toHaveStyle('width: 100%');
|
|
136
|
+
});
|
|
137
|
+
it('should render a button with a leftIcon', function () {
|
|
138
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
139
|
+
leftIcon: "airplay",
|
|
140
|
+
variant: "solid",
|
|
141
|
+
children: "Click Me"
|
|
142
|
+
}));
|
|
143
|
+
|
|
144
|
+
var _setup2 = setup({
|
|
145
|
+
leftIcon: 'airplay'
|
|
146
|
+
}),
|
|
147
|
+
getLeftIcon = _setup2.getLeftIcon;
|
|
148
|
+
|
|
149
|
+
expect(getLeftIcon()).toBeInTheDocument();
|
|
150
|
+
});
|
|
151
|
+
it('should render a button with a rightIcon', function () {
|
|
152
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
153
|
+
rightIcon: "airplay",
|
|
154
|
+
variant: "solid",
|
|
155
|
+
children: "Click Me"
|
|
156
|
+
}));
|
|
157
|
+
|
|
158
|
+
var _setup3 = setup({
|
|
159
|
+
rightIcon: 'airplay'
|
|
160
|
+
}),
|
|
161
|
+
getRightIcon = _setup3.getRightIcon;
|
|
162
|
+
|
|
163
|
+
expect(getRightIcon()).toBeInTheDocument();
|
|
164
|
+
});
|
|
165
|
+
it('should render a button with a grey textColor', function () {
|
|
166
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
167
|
+
textColor: "#8b7e8b",
|
|
168
|
+
children: "Click Me"
|
|
169
|
+
}));
|
|
170
|
+
expect(_react.screen.getByRole('button')).toHaveStyle('color: #8b7e8b');
|
|
171
|
+
});
|
|
172
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.test.d.ts","sourceRoot":"","sources":["../../../src/components/Card/card.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
var setup = function setup(props) {
|
|
18
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Card, _objectSpread({}, props)));
|
|
19
|
+
return utils;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
describe('Card', function () {
|
|
23
|
+
it('Should render a empty card', function () {
|
|
24
|
+
var _setup = setup({}),
|
|
25
|
+
container = _setup.container;
|
|
26
|
+
|
|
27
|
+
expect(container).toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
it('Should render a card with padding', function () {
|
|
30
|
+
var _setup2 = setup({
|
|
31
|
+
cardPadding: '32px'
|
|
32
|
+
}),
|
|
33
|
+
container = _setup2.container;
|
|
34
|
+
|
|
35
|
+
expect(container).toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-input.test.d.ts","sourceRoot":"","sources":["../../../src/components/CheckboxInput/checkbox-input.test.tsx"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAC"}
|