@reltio/components 1.4.1999 → 1.4.2000

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.
Files changed (89) hide show
  1. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
  2. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +288 -0
  3. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +708 -370
  4. package/cjs/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
  5. package/cjs/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
  6. package/cjs/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +265 -193
  7. package/cjs/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
  8. package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
  9. package/cjs/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
  10. package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +323 -225
  11. package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
  12. package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
  13. package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
  14. package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.js +283 -0
  15. package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +711 -350
  16. package/esm/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
  17. package/esm/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
  18. package/esm/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +266 -194
  19. package/esm/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
  20. package/esm/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
  21. package/esm/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
  22. package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +324 -226
  23. package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
  24. package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
  25. package/package.json +1 -1
  26. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
  27. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -52
  28. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts +0 -1
  29. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -323
  30. package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts +0 -1
  31. package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -142
  32. package/cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts +0 -1
  33. package/cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -146
  34. package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
  35. package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -50
  36. package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
  37. package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -58
  38. package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
  39. package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -14
  40. package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
  41. package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -110
  42. package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
  43. package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -111
  44. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
  45. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -67
  46. package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
  47. package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -193
  48. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
  49. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -22
  50. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
  51. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -58
  52. package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
  53. package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -69
  54. package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
  55. package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -137
  56. package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
  57. package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -56
  58. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
  59. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -47
  60. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts +0 -1
  61. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -318
  62. package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts +0 -1
  63. package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -137
  64. package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts +0 -1
  65. package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -141
  66. package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
  67. package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -45
  68. package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
  69. package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -53
  70. package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
  71. package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -9
  72. package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
  73. package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -105
  74. package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
  75. package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -106
  76. package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
  77. package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -62
  78. package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
  79. package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -188
  80. package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
  81. package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -17
  82. package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
  83. package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -53
  84. package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
  85. package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -64
  86. package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
  87. package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -132
  88. package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
  89. package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -28
@@ -1,64 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { InlineAttributesPager } from '../../../../../InlineAttributesPager';
15
- import { SimpleAttributesRenderer } from './SimpleAttributesRenderer';
16
- describe('SimpleAttributesRenderer tests', function () {
17
- it('should render correctly', function () {
18
- var crosswalks = [
19
- {
20
- uri: 'entities/j8K1vc9/crosswalks/12jf9nL05',
21
- type: 'configuration/sources/Reltio',
22
- value: 'nQpZyQt',
23
- reltioLoadDate: '2021-06-11T08:24:31.726Z',
24
- createDate: '2018-11-19T12:14:00.735Z',
25
- updateDate: '2018-11-19T12:14:00.735Z',
26
- attributes: ['entities/1/attributes/CountryCode/1', 'entities/1/attributes/Date/1'],
27
- singleAttributeUpdateDates: {
28
- 'entities/1/attributes/Date/1': '2018-11-29T05:39:56.445Z'
29
- }
30
- }
31
- ];
32
- var props = {
33
- attributeValues: [
34
- {
35
- uri: 'entities/1/attributes/CountryCode/1',
36
- type: 'configuration/entityTypes/HCP/attributes/CountryCode',
37
- value: 'Italy',
38
- lookupCode: 'IT',
39
- ov: true
40
- }
41
- ],
42
- attributeType: {
43
- label: 'Country Code',
44
- name: 'CountryCode',
45
- type: 'String',
46
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
47
- },
48
- crosswalksMap: {
49
- 'entities/1/attributes/CountryCode/1': [crosswalks[0]],
50
- 'entities/1/attributes/Date/1': [crosswalks[0]]
51
- },
52
- onPin: jest.fn(),
53
- onIgnore: jest.fn(),
54
- onEdit: jest.fn(),
55
- onAdd: jest.fn(),
56
- onDelete: jest.fn(),
57
- parentUri: 'entities/1',
58
- emptyTempAttributeUris: []
59
- };
60
- var wrapper = shallow(React.createElement(SimpleAttributesRenderer, __assign({}, props)));
61
- expect(wrapper.find('.basicCell').length).toBe(1);
62
- expect(wrapper.find(InlineAttributesPager).props()).toEqual(props);
63
- });
64
- });
@@ -1,132 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- import React from 'react';
49
- import { render, screen } from '@testing-library/react';
50
- import userEvent from '@testing-library/user-event';
51
- import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
52
- import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
53
- import { CrosswalkDateEditor } from './CrosswalkDateEditor';
54
- describe('CrosswalkDateEditor tests', function () {
55
- afterEach(function () {
56
- jest.clearAllMocks();
57
- });
58
- var date = new Date('01/01/2021').valueOf();
59
- var defaultProps = {
60
- value: date,
61
- classes: { root: 'someClass' },
62
- onChange: jest.fn()
63
- };
64
- var setUp = function (props) {
65
- if (props === void 0) { props = defaultProps; }
66
- var user = userEvent.setup();
67
- var Providers = function (_a) {
68
- var children = _a.children;
69
- return React.createElement(LocalizationProvider, { dateAdapter: AdapterMoment }, children);
70
- };
71
- return __assign(__assign({}, render(React.createElement(CrosswalkDateEditor, __assign({}, props)), { wrapper: Providers })), { user: user });
72
- };
73
- it('new should call props.onChange when calling TimestampEditor onClose prop', function () { return __awaiter(void 0, void 0, void 0, function () {
74
- var user;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0:
78
- user = setUp().user;
79
- return [4 /*yield*/, user.click(screen.getByRole('button'))];
80
- case 1:
81
- _a.sent();
82
- return [4 /*yield*/, user.click(screen.getByText('5'))];
83
- case 2:
84
- _a.sent();
85
- expect(screen.getByDisplayValue('01/05/2021 12:00:00 AM')).toBeInTheDocument();
86
- return [4 /*yield*/, user.click(screen.getAllByRole('button')[0])];
87
- case 3:
88
- _a.sent();
89
- expect(defaultProps.onChange).toHaveBeenCalledWith(new Date('01/05/2021 12:00:00 AM').valueOf());
90
- return [2 /*return*/];
91
- }
92
- });
93
- }); });
94
- it('should call props.onChange when calling TimestampEditor onBlur for input', function () { return __awaiter(void 0, void 0, void 0, function () {
95
- var user, newDate;
96
- return __generator(this, function (_a) {
97
- switch (_a.label) {
98
- case 0:
99
- user = setUp().user;
100
- newDate = '10/10/2021';
101
- return [4 /*yield*/, user.type(screen.getByRole('textbox'), '01/01/2020')];
102
- case 1:
103
- _a.sent();
104
- expect(screen.getByDisplayValue('01/01/2020 12:00:00 AM')).toBeInTheDocument();
105
- return [4 /*yield*/, user.type(screen.getByRole('textbox'), newDate)];
106
- case 2:
107
- _a.sent();
108
- expect(screen.getByDisplayValue('10/10/2021 12:00:00 AM')).toBeInTheDocument();
109
- expect(defaultProps.onChange).not.toHaveBeenCalled();
110
- return [4 /*yield*/, user.tab()];
111
- case 3:
112
- _a.sent();
113
- expect(defaultProps.onChange).toHaveBeenCalledWith(new Date(newDate).valueOf());
114
- return [2 /*return*/];
115
- }
116
- });
117
- }); });
118
- it('should change value of component when value property updated', function () { return __awaiter(void 0, void 0, void 0, function () {
119
- var rerender;
120
- return __generator(this, function (_a) {
121
- switch (_a.label) {
122
- case 0:
123
- rerender = setUp().rerender;
124
- return [4 /*yield*/, rerender(React.createElement(CrosswalkDateEditor, __assign({}, defaultProps, { value: new Date('10/10/2021').valueOf() })))];
125
- case 1:
126
- _a.sent();
127
- expect(screen.getByDisplayValue('10/10/2021 12:00:00 AM')).toBeInTheDocument();
128
- return [2 /*return*/];
129
- }
130
- });
131
- }); });
132
- });
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { mount } from 'enzyme';
3
- import * as CrosswalksDisplay from '../../../../../contexts/CrosswalksDisplayContext';
4
- import { MdmModuleProvider } from '../../../../../contexts/MdmModuleContext';
5
- import { SourceIcon } from '../../../../../SourceIcon';
6
- import { ColoredBlock } from '../../../ColoredBlock';
7
- import { CrosswalkDragPreview } from './CrosswalkDragPreview';
8
- describe('CrosswalkDragPreview tests', function () {
9
- beforeAll(function () {
10
- jest.spyOn(CrosswalksDisplay, 'useCrosswalkColor').mockImplementation(function (crosswalks) { return crosswalks === null || crosswalks === void 0 ? void 0 : crosswalks.value; });
11
- });
12
- it('should render correctly', function () {
13
- var metadata = {
14
- sources: [
15
- {
16
- uri: 'configuration/sources/FB',
17
- label: 'Facebook'
18
- }
19
- ]
20
- };
21
- var crosswalk = { uri: 'entities/1/crosswalks/1', type: 'configuration/sources/FB', value: '123' };
22
- var wrapper = mount(React.createElement(MdmModuleProvider, { values: { metadata: metadata } },
23
- React.createElement(CrosswalkDragPreview, { crosswalk: crosswalk })));
24
- expect(wrapper.find(ColoredBlock).prop('color')).toBe('123');
25
- expect(wrapper.find(SourceIcon).prop('sourceType')).toBe(crosswalk.type);
26
- expect(wrapper.find('p.sourceLabel').text()).toBe('Facebook');
27
- });
28
- });