@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,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = require("@testing-library/react");
|
|
4
|
-
|
|
5
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
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
|
-
var makeSut = function makeSut(props) {
|
|
22
|
-
var sut = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({
|
|
23
|
-
label: "Any Label",
|
|
24
|
-
placeholder: "any placeholder"
|
|
25
|
-
}, props)));
|
|
26
|
-
var textarea = sut.container.querySelector('textarea');
|
|
27
|
-
var helperText = sut.container.querySelector('span');
|
|
28
|
-
return {
|
|
29
|
-
sut: sut,
|
|
30
|
-
textarea: textarea,
|
|
31
|
-
helperText: helperText
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
describe('TextAreaInput', function () {
|
|
36
|
-
it('should render with correct placeholder', function () {
|
|
37
|
-
var _makeSut = makeSut(),
|
|
38
|
-
sut = _makeSut.sut;
|
|
39
|
-
|
|
40
|
-
expect(sut.getByPlaceholderText('any placeholder')).toHaveAttribute('placeholder', 'any placeholder');
|
|
41
|
-
});
|
|
42
|
-
it('should render with correct label text', function () {
|
|
43
|
-
var _makeSut2 = makeSut(),
|
|
44
|
-
sut = _makeSut2.sut;
|
|
45
|
-
|
|
46
|
-
expect(sut.getByText('Any Label', {
|
|
47
|
-
selector: 'label'
|
|
48
|
-
}).innerHTML).toBe('Any Label');
|
|
49
|
-
});
|
|
50
|
-
it('should disabled textarea when prop isDisabled is provided', function () {
|
|
51
|
-
var _makeSut3 = makeSut({
|
|
52
|
-
isDisabled: true
|
|
53
|
-
}),
|
|
54
|
-
sut = _makeSut3.sut;
|
|
55
|
-
|
|
56
|
-
expect(sut.container.querySelector('textarea')).toBeDisabled();
|
|
57
|
-
});
|
|
58
|
-
it('should textarea change value on typing', function () {
|
|
59
|
-
var _makeSut4 = makeSut(),
|
|
60
|
-
textarea = _makeSut4.textarea;
|
|
61
|
-
|
|
62
|
-
_react.fireEvent.change(textarea, {
|
|
63
|
-
target: {
|
|
64
|
-
value: 'any_text'
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
expect(textarea.value).toBe('any_text');
|
|
69
|
-
});
|
|
70
|
-
it('should show helperText with isInvalid is provided', function () {
|
|
71
|
-
var _makeSut5 = makeSut({
|
|
72
|
-
isInvalid: true,
|
|
73
|
-
helperText: 'any help text'
|
|
74
|
-
}),
|
|
75
|
-
helperText = _makeSut5.helperText;
|
|
76
|
-
|
|
77
|
-
expect(helperText).toBeInTheDocument();
|
|
78
|
-
});
|
|
79
|
-
it('should not show helperText with isInvalid not provided', function () {
|
|
80
|
-
var _makeSut6 = makeSut({
|
|
81
|
-
isInvalid: false,
|
|
82
|
-
helperText: 'any help text'
|
|
83
|
-
}),
|
|
84
|
-
helperText = _makeSut6.helperText;
|
|
85
|
-
|
|
86
|
-
expect(helperText).not.toBeInTheDocument();
|
|
87
|
-
});
|
|
88
|
-
it('should not render helperText with helperText not provided', function () {
|
|
89
|
-
var _makeSut7 = makeSut({
|
|
90
|
-
isInvalid: true
|
|
91
|
-
}),
|
|
92
|
-
helperText = _makeSut7.helperText;
|
|
93
|
-
|
|
94
|
-
expect(helperText).not.toBeInTheDocument();
|
|
95
|
-
});
|
|
96
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"thumbnail.test.d.ts","sourceRoot":"","sources":["../../../src/components/Thumbnail/thumbnail.test.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,82 +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 _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
10
|
-
|
|
11
|
-
var _ = require(".");
|
|
12
|
-
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
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; }
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
21
|
-
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; }
|
|
22
|
-
|
|
23
|
-
var makeSut = function makeSut(props) {
|
|
24
|
-
var _render = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Thumbnail, _objectSpread({}, props))),
|
|
25
|
-
container = _render.container;
|
|
26
|
-
|
|
27
|
-
var file = new File(['any_content'], 'any_name.png', {
|
|
28
|
-
type: 'image/png'
|
|
29
|
-
});
|
|
30
|
-
var input = container.querySelector('input[type=file]');
|
|
31
|
-
return {
|
|
32
|
-
container: container,
|
|
33
|
-
file: file,
|
|
34
|
-
input: input
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
describe('Thumbnail', function () {
|
|
39
|
-
beforeEach(function () {
|
|
40
|
-
window.URL.createObjectURL = jest.fn(function () {
|
|
41
|
-
return 'blob_url';
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
it('Should render Thumbnail with url', function () {
|
|
45
|
-
makeSut({
|
|
46
|
-
src: 'https://image.flaticon.com/icons/png/512/833/833268.png',
|
|
47
|
-
alt: 'any_alt'
|
|
48
|
-
});
|
|
49
|
-
expect(_react.screen.getByAltText('any_alt')).toBeInTheDocument();
|
|
50
|
-
});
|
|
51
|
-
it('Should input recieve file', function () {
|
|
52
|
-
var _makeSut = makeSut(),
|
|
53
|
-
file = _makeSut.file,
|
|
54
|
-
input = _makeSut.input;
|
|
55
|
-
|
|
56
|
-
_userEvent.default.upload(input, file);
|
|
57
|
-
|
|
58
|
-
expect(input.files && input.files[0]).toStrictEqual(file);
|
|
59
|
-
});
|
|
60
|
-
it('Should render preview image', function () {
|
|
61
|
-
var _makeSut2 = makeSut(),
|
|
62
|
-
file = _makeSut2.file,
|
|
63
|
-
input = _makeSut2.input;
|
|
64
|
-
|
|
65
|
-
_userEvent.default.upload(input, file);
|
|
66
|
-
|
|
67
|
-
expect(_react.screen.getByAltText(file.name)).toBeInTheDocument();
|
|
68
|
-
});
|
|
69
|
-
it('Should return image on onSelect', function () {
|
|
70
|
-
var mockState = jest.fn();
|
|
71
|
-
|
|
72
|
-
var _makeSut3 = makeSut({
|
|
73
|
-
getThumbImage: mockState
|
|
74
|
-
}),
|
|
75
|
-
file = _makeSut3.file,
|
|
76
|
-
input = _makeSut3.input;
|
|
77
|
-
|
|
78
|
-
_userEvent.default.upload(input, file);
|
|
79
|
-
|
|
80
|
-
expect(mockState).toBeCalledWith(file);
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.test.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/timeline.test.tsx"],"names":[],"mappings":"AAEA,OAAO,yCAAyC,CAAC"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
|
-
require("@testing-library/jest-dom/extend-expect");
|
|
6
|
-
|
|
7
|
-
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
8
|
-
|
|
9
|
-
var _ = require(".");
|
|
10
|
-
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
|
-
describe('Timeline', function () {
|
|
16
|
-
it('should it render the Timeline component with childrens', function () {
|
|
17
|
-
var _render = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
18
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
19
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
20
|
-
title: "Title",
|
|
21
|
-
description: "Description",
|
|
22
|
-
date: new Date()
|
|
23
|
-
})]
|
|
24
|
-
})
|
|
25
|
-
})),
|
|
26
|
-
container = _render.container;
|
|
27
|
-
|
|
28
|
-
expect(container).toBeInTheDocument();
|
|
29
|
-
});
|
|
30
|
-
it('should it render the Timeline component with different position', function () {
|
|
31
|
-
var _render2 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
32
|
-
position: "right",
|
|
33
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
34
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
35
|
-
title: "Title",
|
|
36
|
-
description: "Description",
|
|
37
|
-
date: new Date()
|
|
38
|
-
})]
|
|
39
|
-
})
|
|
40
|
-
})),
|
|
41
|
-
container = _render2.container;
|
|
42
|
-
|
|
43
|
-
expect(container).toBeInTheDocument();
|
|
44
|
-
});
|
|
45
|
-
it('should it render the Timeline component with full width', function () {
|
|
46
|
-
var _render3 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
47
|
-
fullWidth: true,
|
|
48
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
49
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
50
|
-
title: "Title",
|
|
51
|
-
description: "Description",
|
|
52
|
-
date: new Date()
|
|
53
|
-
})]
|
|
54
|
-
})
|
|
55
|
-
})),
|
|
56
|
-
container = _render3.container;
|
|
57
|
-
|
|
58
|
-
expect(container).toBeInTheDocument();
|
|
59
|
-
});
|
|
60
|
-
it('should it render the TimelineSeparator component with an icon', function () {
|
|
61
|
-
var _render4 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
62
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
63
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
64
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
65
|
-
name: "shopping-cart"
|
|
66
|
-
})
|
|
67
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
68
|
-
title: "Title",
|
|
69
|
-
description: "Description",
|
|
70
|
-
date: new Date()
|
|
71
|
-
})]
|
|
72
|
-
})
|
|
73
|
-
})),
|
|
74
|
-
container = _render4.container;
|
|
75
|
-
|
|
76
|
-
expect(container).toBeInTheDocument();
|
|
77
|
-
expect(container.querySelector('svg')).toBeInTheDocument();
|
|
78
|
-
});
|
|
79
|
-
it('should it render the TimelineSeparator component with an icon and different color in the circle', function () {
|
|
80
|
-
var _render5 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
81
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
82
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
83
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
84
|
-
name: "shopping-cart"
|
|
85
|
-
}),
|
|
86
|
-
circleColor: "primary.default"
|
|
87
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
88
|
-
title: "Title",
|
|
89
|
-
description: "Description",
|
|
90
|
-
date: new Date()
|
|
91
|
-
})]
|
|
92
|
-
})
|
|
93
|
-
})),
|
|
94
|
-
container = _render5.container;
|
|
95
|
-
|
|
96
|
-
expect(container).toBeInTheDocument();
|
|
97
|
-
expect(container.querySelector('svg')).toBeInTheDocument();
|
|
98
|
-
});
|
|
99
|
-
it('should it render the Timeline component with multiply childrens', function () {
|
|
100
|
-
var _render6 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.Timeline, {
|
|
101
|
-
position: "alternate",
|
|
102
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
103
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
104
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
105
|
-
name: "shopping-cart"
|
|
106
|
-
}),
|
|
107
|
-
circleColor: "primary.default"
|
|
108
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
109
|
-
title: "Title",
|
|
110
|
-
description: "Description",
|
|
111
|
-
date: new Date()
|
|
112
|
-
})]
|
|
113
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
114
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
115
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
116
|
-
name: "shopping-cart"
|
|
117
|
-
}),
|
|
118
|
-
circleColor: "primary.default"
|
|
119
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
120
|
-
title: "Title",
|
|
121
|
-
description: "Description",
|
|
122
|
-
date: new Date()
|
|
123
|
-
})]
|
|
124
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
125
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
126
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
127
|
-
name: "shopping-cart"
|
|
128
|
-
}),
|
|
129
|
-
circleColor: "primary.default"
|
|
130
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
131
|
-
title: "Title",
|
|
132
|
-
description: "Description",
|
|
133
|
-
date: new Date()
|
|
134
|
-
})]
|
|
135
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
136
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
137
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
138
|
-
name: "shopping-cart"
|
|
139
|
-
}),
|
|
140
|
-
circleColor: "primary.default"
|
|
141
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
142
|
-
title: "Title",
|
|
143
|
-
description: "Description",
|
|
144
|
-
date: new Date()
|
|
145
|
-
})]
|
|
146
|
-
})]
|
|
147
|
-
})),
|
|
148
|
-
container = _render6.container;
|
|
149
|
-
|
|
150
|
-
expect(container).toBeInTheDocument();
|
|
151
|
-
});
|
|
152
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toast.test.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/toast.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
|
-
require("@testing-library/jest-dom");
|
|
6
|
-
|
|
7
|
-
var _buttonExample = _interopRequireDefault(require("./button-example"));
|
|
8
|
-
|
|
9
|
-
var _ToastProvider = _interopRequireDefault(require("./contexts/ToastProvider"));
|
|
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
|
-
var setup = function setup(props) {
|
|
22
|
-
return (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToastProvider.default, {
|
|
23
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_buttonExample.default, _objectSpread({}, props))
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
describe('Toast', function () {
|
|
28
|
-
it('should it render the toast on the screen', function () {
|
|
29
|
-
var container = setup({
|
|
30
|
-
title: 'Toast Title',
|
|
31
|
-
content: 'Toast Message',
|
|
32
|
-
type: 'success'
|
|
33
|
-
});
|
|
34
|
-
container.getByText('Show toast').click();
|
|
35
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
36
|
-
});
|
|
37
|
-
it('should it render the toast on position top of the screen', function () {
|
|
38
|
-
var container = setup({
|
|
39
|
-
title: 'Toast Title',
|
|
40
|
-
content: 'Toast Message',
|
|
41
|
-
type: 'success',
|
|
42
|
-
position: 'top'
|
|
43
|
-
});
|
|
44
|
-
container.getByText('Show toast').click();
|
|
45
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
46
|
-
});
|
|
47
|
-
it('should it render the toast on position top-left of the screen', function () {
|
|
48
|
-
var container = setup({
|
|
49
|
-
title: 'Toast Title',
|
|
50
|
-
content: 'Toast Message',
|
|
51
|
-
type: 'success',
|
|
52
|
-
position: 'top-left'
|
|
53
|
-
});
|
|
54
|
-
container.getByText('Show toast').click();
|
|
55
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
56
|
-
});
|
|
57
|
-
it('should it render the toast on position top-right of the screen', function () {
|
|
58
|
-
var container = setup({
|
|
59
|
-
title: 'Toast Title',
|
|
60
|
-
content: 'Toast Message',
|
|
61
|
-
type: 'success',
|
|
62
|
-
position: 'top-right'
|
|
63
|
-
});
|
|
64
|
-
container.getByText('Show toast').click();
|
|
65
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
66
|
-
});
|
|
67
|
-
it('should it render the toast on position bottom of the screen', function () {
|
|
68
|
-
var container = setup({
|
|
69
|
-
title: 'Toast Title',
|
|
70
|
-
content: 'Toast Message',
|
|
71
|
-
type: 'success',
|
|
72
|
-
position: 'bottom'
|
|
73
|
-
});
|
|
74
|
-
container.getByText('Show toast').click();
|
|
75
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
76
|
-
});
|
|
77
|
-
it('should it render the toast on position bottom-left of the screen', function () {
|
|
78
|
-
var container = setup({
|
|
79
|
-
title: 'Toast Title',
|
|
80
|
-
content: 'Toast Message',
|
|
81
|
-
type: 'success',
|
|
82
|
-
position: 'bottom-left'
|
|
83
|
-
});
|
|
84
|
-
container.getByText('Show toast').click();
|
|
85
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
86
|
-
});
|
|
87
|
-
it('should it render the toast on position bottom-right of the screen', function () {
|
|
88
|
-
var container = setup({
|
|
89
|
-
title: 'Toast Title',
|
|
90
|
-
content: 'Toast Message',
|
|
91
|
-
type: 'success',
|
|
92
|
-
position: 'bottom-right'
|
|
93
|
-
});
|
|
94
|
-
container.getByText('Show toast').click();
|
|
95
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
96
|
-
});
|
|
97
|
-
it('should it render the toast on the screen and close it by alert close button', function () {
|
|
98
|
-
var _container$baseElemen;
|
|
99
|
-
|
|
100
|
-
var container = setup({
|
|
101
|
-
title: 'Toast Title',
|
|
102
|
-
content: 'Toast Message',
|
|
103
|
-
type: 'success'
|
|
104
|
-
});
|
|
105
|
-
container.getByText('Show toast').click();
|
|
106
|
-
(_container$baseElemen = container.baseElement.querySelectorAll('svg')[1].parentElement) === null || _container$baseElemen === void 0 ? void 0 : _container$baseElemen.click();
|
|
107
|
-
setTimeout(function () {
|
|
108
|
-
expect(container.getByText('Toast Title')).not.toBeInTheDocument();
|
|
109
|
-
}, 500);
|
|
110
|
-
});
|
|
111
|
-
it('should it call the callback provided in onClose prop', function () {
|
|
112
|
-
var _container$baseElemen2;
|
|
113
|
-
|
|
114
|
-
var onClose = jest.fn();
|
|
115
|
-
var container = setup({
|
|
116
|
-
title: 'Toast Title',
|
|
117
|
-
content: 'Toast Message',
|
|
118
|
-
type: 'success',
|
|
119
|
-
onClose: onClose
|
|
120
|
-
});
|
|
121
|
-
container.getByText('Show toast').click();
|
|
122
|
-
(_container$baseElemen2 = container.baseElement.querySelectorAll('svg')[1].parentElement) === null || _container$baseElemen2 === void 0 ? void 0 : _container$baseElemen2.click();
|
|
123
|
-
expect(onClose).toHaveBeenCalled();
|
|
124
|
-
});
|
|
125
|
-
it('should it call the callback provided in onClose prop and pass the id', function () {
|
|
126
|
-
var _container$baseElemen3;
|
|
127
|
-
|
|
128
|
-
var onClose = jest.fn();
|
|
129
|
-
var container = setup({
|
|
130
|
-
title: 'Toast Title',
|
|
131
|
-
content: 'Toast Message',
|
|
132
|
-
type: 'success',
|
|
133
|
-
onClose: onClose
|
|
134
|
-
});
|
|
135
|
-
container.getByText('Show toast').click();
|
|
136
|
-
(_container$baseElemen3 = container.baseElement.querySelectorAll('svg')[1].parentElement) === null || _container$baseElemen3 === void 0 ? void 0 : _container$baseElemen3.click();
|
|
137
|
-
expect(onClose).toHaveBeenCalledWith(expect.any(String));
|
|
138
|
-
});
|
|
139
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typography.test.d.ts","sourceRoot":"","sources":["../../../src/components/Typography/typography.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|