@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,74 +0,0 @@
|
|
|
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('Color Picker', function () {
|
|
25
|
-
it('should it render the color picker component', function () {
|
|
26
|
-
var props = {
|
|
27
|
-
initialColor: '#ffffff',
|
|
28
|
-
onChange: jest.fn(),
|
|
29
|
-
onCancel: jest.fn(),
|
|
30
|
-
onSave: jest.fn()
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var _setup = setup(props),
|
|
34
|
-
container = _setup.container;
|
|
35
|
-
|
|
36
|
-
expect(container).toBeInTheDocument();
|
|
37
|
-
});
|
|
38
|
-
it('should it receive an initial color', function () {
|
|
39
|
-
var props = {
|
|
40
|
-
initialColor: '#ffffff',
|
|
41
|
-
onChange: jest.fn(),
|
|
42
|
-
onCancel: jest.fn(),
|
|
43
|
-
onSave: jest.fn()
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
var _setup2 = setup(props),
|
|
47
|
-
container = _setup2.container;
|
|
48
|
-
|
|
49
|
-
var color = container.querySelector('input');
|
|
50
|
-
expect(color).toHaveValue('#ffffff');
|
|
51
|
-
});
|
|
52
|
-
it('should it callback the onsave function', function () {
|
|
53
|
-
var props = {
|
|
54
|
-
initialColor: '#ffffff',
|
|
55
|
-
onChange: jest.fn(),
|
|
56
|
-
onCancel: jest.fn(),
|
|
57
|
-
onSave: jest.fn()
|
|
58
|
-
};
|
|
59
|
-
var component = setup(props);
|
|
60
|
-
component.getByText('Salvar cor').click();
|
|
61
|
-
expect(props.onSave).toHaveBeenCalled();
|
|
62
|
-
});
|
|
63
|
-
it('should it callback the oncancel function', function () {
|
|
64
|
-
var props = {
|
|
65
|
-
initialColor: '#ffffff',
|
|
66
|
-
onChange: jest.fn(),
|
|
67
|
-
onCancel: jest.fn(),
|
|
68
|
-
onSave: jest.fn()
|
|
69
|
-
};
|
|
70
|
-
var component = setup(props);
|
|
71
|
-
component.getByText('Cancelar').click();
|
|
72
|
-
expect(props.onCancel).toHaveBeenCalled();
|
|
73
|
-
});
|
|
74
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dateInput.test.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/dateInput.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
|
-
require("@testing-library/jest-dom");
|
|
6
|
-
|
|
7
|
-
var _DateInputExample = _interopRequireDefault(require("./DateInput-example"));
|
|
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)(_DateInputExample.default, _objectSpread({}, props)));
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
describe('DateInput', function () {
|
|
24
|
-
it('should it render the datepicker component', function () {
|
|
25
|
-
var _setup = setup(),
|
|
26
|
-
container = _setup.container;
|
|
27
|
-
|
|
28
|
-
expect(container).toBeInTheDocument();
|
|
29
|
-
});
|
|
30
|
-
it('should set a value in DateInput', function () {
|
|
31
|
-
var _setup2 = setup({
|
|
32
|
-
type: 'date',
|
|
33
|
-
label: 'label',
|
|
34
|
-
// value:
|
|
35
|
-
onChange: jest.fn()
|
|
36
|
-
}),
|
|
37
|
-
container = _setup2.container;
|
|
38
|
-
|
|
39
|
-
expect(container).toBeInTheDocument();
|
|
40
|
-
});
|
|
41
|
-
it('should render the datepicker with minimum and maximum dates', function () {
|
|
42
|
-
var _setup3 = setup({
|
|
43
|
-
value: new Date(),
|
|
44
|
-
onChange: jest.fn(),
|
|
45
|
-
minDate: new Date(),
|
|
46
|
-
maxDate: new Date()
|
|
47
|
-
}),
|
|
48
|
-
container = _setup3.container;
|
|
49
|
-
|
|
50
|
-
expect(container).toBeInTheDocument();
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker.test.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/datepicker.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,138 +0,0 @@
|
|
|
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('DatePicker', function () {
|
|
24
|
-
it('should it render the datepicker component', function () {
|
|
25
|
-
var _setup = setup({
|
|
26
|
-
value: new Date(),
|
|
27
|
-
onChange: jest.fn()
|
|
28
|
-
}),
|
|
29
|
-
container = _setup.container;
|
|
30
|
-
|
|
31
|
-
expect(container).toBeInTheDocument();
|
|
32
|
-
});
|
|
33
|
-
it('should it render the datepicker as range type', function () {
|
|
34
|
-
var _setup2 = setup({
|
|
35
|
-
value: new Date(),
|
|
36
|
-
onChange: jest.fn(),
|
|
37
|
-
type: 'range'
|
|
38
|
-
}),
|
|
39
|
-
container = _setup2.container;
|
|
40
|
-
|
|
41
|
-
expect(container).toBeInTheDocument();
|
|
42
|
-
});
|
|
43
|
-
it('should it render the datepicker as extended variant', function () {
|
|
44
|
-
var _setup3 = setup({
|
|
45
|
-
value: new Date(),
|
|
46
|
-
onChange: jest.fn(),
|
|
47
|
-
variant: 'extended'
|
|
48
|
-
}),
|
|
49
|
-
container = _setup3.container;
|
|
50
|
-
|
|
51
|
-
expect(container).toBeInTheDocument();
|
|
52
|
-
});
|
|
53
|
-
it('should it render the datepicker with minimum and maximum dates', function () {
|
|
54
|
-
var _setup4 = setup({
|
|
55
|
-
value: new Date(),
|
|
56
|
-
onChange: jest.fn(),
|
|
57
|
-
minDate: new Date(),
|
|
58
|
-
maxDate: new Date()
|
|
59
|
-
}),
|
|
60
|
-
container = _setup4.container;
|
|
61
|
-
|
|
62
|
-
expect(container).toBeInTheDocument();
|
|
63
|
-
});
|
|
64
|
-
it('should it call the onChange function with one date value', function () {
|
|
65
|
-
var onChange = jest.fn();
|
|
66
|
-
|
|
67
|
-
var _setup5 = setup({
|
|
68
|
-
value: new Date(),
|
|
69
|
-
onChange: onChange
|
|
70
|
-
}),
|
|
71
|
-
container = _setup5.container;
|
|
72
|
-
|
|
73
|
-
var dateCells = document.querySelectorAll('td[role="gridcell"]');
|
|
74
|
-
dateCells[20].dispatchEvent(new MouseEvent('click', {
|
|
75
|
-
bubbles: true
|
|
76
|
-
}));
|
|
77
|
-
expect(container).toBeInTheDocument();
|
|
78
|
-
expect(onChange).toHaveBeenCalled();
|
|
79
|
-
});
|
|
80
|
-
it('should it call the onChange function with two date values in range type', function () {
|
|
81
|
-
var onChange = jest.fn();
|
|
82
|
-
|
|
83
|
-
var _setup6 = setup({
|
|
84
|
-
value: new Date(),
|
|
85
|
-
onChange: onChange,
|
|
86
|
-
type: 'range'
|
|
87
|
-
}),
|
|
88
|
-
container = _setup6.container;
|
|
89
|
-
|
|
90
|
-
var dateCells = document.querySelectorAll('td[role="gridcell"]');
|
|
91
|
-
dateCells[20].dispatchEvent(new MouseEvent('click', {
|
|
92
|
-
bubbles: true
|
|
93
|
-
}));
|
|
94
|
-
dateCells[25].dispatchEvent(new MouseEvent('click', {
|
|
95
|
-
bubbles: true
|
|
96
|
-
}));
|
|
97
|
-
expect(container).toBeInTheDocument();
|
|
98
|
-
expect(onChange).toHaveBeenCalled();
|
|
99
|
-
});
|
|
100
|
-
it('should it call the onChange function with one date value in the extended variant', function () {
|
|
101
|
-
var onChange = jest.fn();
|
|
102
|
-
|
|
103
|
-
var _setup7 = setup({
|
|
104
|
-
value: new Date(),
|
|
105
|
-
onChange: onChange,
|
|
106
|
-
variant: 'extended'
|
|
107
|
-
}),
|
|
108
|
-
container = _setup7.container;
|
|
109
|
-
|
|
110
|
-
var dateCells = document.querySelectorAll('td[role="gridcell"]');
|
|
111
|
-
dateCells[20].dispatchEvent(new MouseEvent('click', {
|
|
112
|
-
bubbles: true
|
|
113
|
-
}));
|
|
114
|
-
expect(container).toBeInTheDocument();
|
|
115
|
-
expect(onChange).toHaveBeenCalled();
|
|
116
|
-
});
|
|
117
|
-
it('should it call the onChange function with two date values in the extended variant', function () {
|
|
118
|
-
var onChange = jest.fn();
|
|
119
|
-
|
|
120
|
-
var _setup8 = setup({
|
|
121
|
-
value: new Date(),
|
|
122
|
-
onChange: onChange,
|
|
123
|
-
type: 'range',
|
|
124
|
-
variant: 'extended'
|
|
125
|
-
}),
|
|
126
|
-
container = _setup8.container;
|
|
127
|
-
|
|
128
|
-
var dateCells = document.querySelectorAll('td[role="gridcell"]');
|
|
129
|
-
dateCells[20].dispatchEvent(new MouseEvent('click', {
|
|
130
|
-
bubbles: true
|
|
131
|
-
}));
|
|
132
|
-
dateCells[60].dispatchEvent(new MouseEvent('click', {
|
|
133
|
-
bubbles: true
|
|
134
|
-
}));
|
|
135
|
-
expect(container).toBeInTheDocument();
|
|
136
|
-
expect(onChange).toHaveBeenCalled();
|
|
137
|
-
});
|
|
138
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.test.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/dialog.test.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,81 +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 _ThemeContext = require("../../shared/theme/contexts/ThemeContext");
|
|
10
|
-
|
|
11
|
-
var _ = require(".");
|
|
12
|
-
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
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
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeContext.PPUIThemeProvider, {
|
|
23
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Dialog, _objectSpread({}, props))
|
|
24
|
-
}));
|
|
25
|
-
return _objectSpread({}, utils);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
describe('Dialog', function () {
|
|
29
|
-
it('should render the dialog component', function () {
|
|
30
|
-
var _setup = setup({
|
|
31
|
-
open: true,
|
|
32
|
-
title: 'Title',
|
|
33
|
-
message: 'test',
|
|
34
|
-
onClose: function onClose() {}
|
|
35
|
-
}),
|
|
36
|
-
container = _setup.container;
|
|
37
|
-
|
|
38
|
-
expect(container).toBeInTheDocument();
|
|
39
|
-
});
|
|
40
|
-
it('should call the close callback in the dialog component', function () {
|
|
41
|
-
var onClose = jest.fn();
|
|
42
|
-
|
|
43
|
-
var _setup2 = setup({
|
|
44
|
-
open: true,
|
|
45
|
-
title: 'Title',
|
|
46
|
-
message: 'test',
|
|
47
|
-
onClose: onClose,
|
|
48
|
-
closeButton: true
|
|
49
|
-
}),
|
|
50
|
-
container = _setup2.container;
|
|
51
|
-
|
|
52
|
-
var closeButton = container.querySelector('.ppui-dialog__close-button');
|
|
53
|
-
expect(closeButton).toBeInTheDocument();
|
|
54
|
-
|
|
55
|
-
_react.fireEvent.click(closeButton);
|
|
56
|
-
});
|
|
57
|
-
it('should render the dialog component with the correct title', function () {
|
|
58
|
-
var _setup3 = setup({
|
|
59
|
-
open: true,
|
|
60
|
-
title: 'Title',
|
|
61
|
-
message: 'test',
|
|
62
|
-
onClose: function onClose() {}
|
|
63
|
-
}),
|
|
64
|
-
getByText = _setup3.getByText;
|
|
65
|
-
|
|
66
|
-
expect(getByText('Title')).toBeInTheDocument();
|
|
67
|
-
});
|
|
68
|
-
it('should render the dialog component with different icon', function () {
|
|
69
|
-
var _setup4 = setup({
|
|
70
|
-
open: true,
|
|
71
|
-
title: 'Title',
|
|
72
|
-
message: 'test',
|
|
73
|
-
onClose: function onClose() {},
|
|
74
|
-
illustration: 'illust-banking-billet'
|
|
75
|
-
}),
|
|
76
|
-
container = _setup4.container;
|
|
77
|
-
|
|
78
|
-
var main = container.querySelector('[name="illust-gift"]');
|
|
79
|
-
expect(main).toBeInTheDocument();
|
|
80
|
-
});
|
|
81
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dropzone.test.d.ts","sourceRoot":"","sources":["../../../src/components/Dropzone/dropzone.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
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('Dropzone', function () {
|
|
25
|
-
beforeAll(function () {
|
|
26
|
-
window.URL.createObjectURL = jest.fn();
|
|
27
|
-
});
|
|
28
|
-
it('should it render the dropzone correctly', function () {
|
|
29
|
-
var _setup = setup({
|
|
30
|
-
onChange: jest.fn(),
|
|
31
|
-
onDropAccepted: jest.fn(),
|
|
32
|
-
onDropRejected: jest.fn(),
|
|
33
|
-
onDragEnter: jest.fn(),
|
|
34
|
-
onDragLeave: jest.fn()
|
|
35
|
-
}),
|
|
36
|
-
container = _setup.container;
|
|
37
|
-
|
|
38
|
-
expect(container).toBeInTheDocument();
|
|
39
|
-
});
|
|
40
|
-
it('shoud it render the dropzone with multiple prop', function () {
|
|
41
|
-
var _setup2 = setup({
|
|
42
|
-
onChange: jest.fn(),
|
|
43
|
-
onDropAccepted: jest.fn(),
|
|
44
|
-
onDropRejected: jest.fn(),
|
|
45
|
-
onDragEnter: jest.fn(),
|
|
46
|
-
onDragLeave: jest.fn(),
|
|
47
|
-
multiple: true
|
|
48
|
-
}),
|
|
49
|
-
container = _setup2.container;
|
|
50
|
-
|
|
51
|
-
expect(container).toBeInTheDocument();
|
|
52
|
-
});
|
|
53
|
-
it('should it render the dropzone with accept prop', function () {
|
|
54
|
-
var _setup3 = setup({
|
|
55
|
-
onChange: jest.fn(),
|
|
56
|
-
onDropAccepted: jest.fn(),
|
|
57
|
-
onDropRejected: jest.fn(),
|
|
58
|
-
onDragEnter: jest.fn(),
|
|
59
|
-
onDragLeave: jest.fn(),
|
|
60
|
-
accept: 'image/*'
|
|
61
|
-
}),
|
|
62
|
-
container = _setup3.container;
|
|
63
|
-
|
|
64
|
-
expect(container).toBeInTheDocument();
|
|
65
|
-
});
|
|
66
|
-
it('should it render the dropzone with disabled prop', function () {
|
|
67
|
-
var _setup4 = setup({
|
|
68
|
-
onChange: jest.fn(),
|
|
69
|
-
onDropAccepted: jest.fn(),
|
|
70
|
-
onDropRejected: jest.fn(),
|
|
71
|
-
onDragEnter: jest.fn(),
|
|
72
|
-
onDragLeave: jest.fn(),
|
|
73
|
-
disabled: true
|
|
74
|
-
}),
|
|
75
|
-
container = _setup4.container;
|
|
76
|
-
|
|
77
|
-
expect(container).toBeInTheDocument();
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flex.test.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/flex.test.tsx"],"names":[],"mappings":"AAIA,OAAO,2BAA2B,CAAC"}
|