@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,53 +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 DialogContentText from '@mui/material/DialogContentText';
15
- import RadioGroup from '@mui/material/RadioGroup';
16
- import Button from '@mui/material/Button';
17
- import { ConfirmEditIgnoredDialog } from './ConfirmEditIgnoredDialog';
18
- describe('ConfirmEditIgnoredDialog tests', function () {
19
- var props = {
20
- open: true,
21
- onClose: jest.fn(),
22
- onConfirmEditWithIgnore: jest.fn(),
23
- onConfirmEditWithoutIgnore: jest.fn()
24
- };
25
- it('should render correctly', function () {
26
- var wrapper = shallow(React.createElement(ConfirmEditIgnoredDialog, __assign({}, props)));
27
- expect(wrapper.find(DialogContentText).text()).toBe('You are attempting to change a value that is presently ignored.');
28
- expect(wrapper.find(RadioGroup).prop('value')).toBe(wrapper.find(RadioGroup).childAt(0).prop('value'));
29
- expect(wrapper.find(RadioGroup).childAt(0).prop('label')).toBe('Save without Ignore');
30
- expect(wrapper.find(RadioGroup).childAt(1).prop('label')).toBe('Save and apply Ignore to new value');
31
- expect(wrapper.find(Button).at(0).text()).toBe('Cancel');
32
- expect(wrapper.find(Button).at(1).text()).toBe('Ok');
33
- });
34
- it('should call props.onClose on Cancel button click', function () {
35
- var wrapper = shallow(React.createElement(ConfirmEditIgnoredDialog, __assign({}, props)));
36
- wrapper.find(Button).at(0).simulate('click');
37
- expect(props.onClose).toHaveBeenCalled();
38
- });
39
- it('should call props.onConfirmEditWithoutIgnore and props.onClose on Ok button click', function () {
40
- var wrapper = shallow(React.createElement(ConfirmEditIgnoredDialog, __assign({}, props)));
41
- wrapper.find(Button).at(1).simulate('click');
42
- expect(props.onClose).toHaveBeenCalled();
43
- expect(props.onConfirmEditWithoutIgnore).toHaveBeenCalled();
44
- });
45
- it('should call props.onConfirmEditWithIgnore and props.onClose on with ignore select and Ok button click', function () {
46
- var wrapper = shallow(React.createElement(ConfirmEditIgnoredDialog, __assign({}, props)));
47
- var value = wrapper.find(RadioGroup).childAt(1).prop('value');
48
- wrapper.find(RadioGroup).simulate('change', { target: { value: value } });
49
- wrapper.find(Button).at(1).simulate('click');
50
- expect(props.onClose).toHaveBeenCalled();
51
- expect(props.onConfirmEditWithIgnore).toHaveBeenCalled();
52
- });
53
- });
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { CountRenderer } from './CountRenderer';
4
- describe('CountRenderer tests', function () {
5
- it('should render correctly', function () {
6
- var wrapper = shallow(React.createElement(CountRenderer, { value: 123 }));
7
- expect(wrapper.find('.root').text()).toBe('123');
8
- });
9
- });
@@ -1,105 +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 __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import React from 'react';
24
- import { shallow } from 'enzyme';
25
- import { InlineImageAttribute } from '../../../../../InlineImageAttribute';
26
- import { ImageAttributesRenderer } from './ImageAttributesRenderer';
27
- describe('ImageAttributesRenderer tests', function () {
28
- it('should render correctly', function () {
29
- var crosswalks = [
30
- {
31
- uri: 'entities/j8K1vc9/crosswalks/12jf9nL05',
32
- type: 'configuration/sources/Reltio',
33
- value: 'nQpZyQt',
34
- reltioLoadDate: '2021-06-11T08:24:31.726Z',
35
- createDate: '2018-11-19T12:14:00.735Z',
36
- updateDate: '2018-11-19T12:14:00.735Z',
37
- attributes: ['configuration/entityTypes/Employee/attributes/ImageGallery/attributes/UrlThumbnail']
38
- }
39
- ];
40
- var props = {
41
- attributeValues: [
42
- {
43
- type: 'configuration/entityTypes/Employee/attributes/ImageGallery',
44
- uri: 'entities/1Rd2I9Mt/attributes/ImageGallery/39V5GWJZv',
45
- value: {
46
- UrlThumbnail: [
47
- {
48
- type: 'configuration/entityTypes/Employee/attributes/ImageGallery/attributes/UrlThumbnail',
49
- ov: true,
50
- value: '/test123.jpg',
51
- uri: 'entities/1Rd2I9Mt/attributes/ImageGallery/39V5GWJZv/UrlThumbnail/5555'
52
- }
53
- ]
54
- },
55
- ov: true
56
- },
57
- {
58
- type: 'configuration/entityTypes/Employee/attributes/ImageGallery',
59
- uri: 'entities/1Rd2I9Mt/attributes/ImageGallery/123123',
60
- value: {
61
- UrlThumbnail: [
62
- {
63
- type: 'configuration/entityTypes/Employee/attributes/ImageGallery/attributes/UrlThumbnail',
64
- ov: true,
65
- value: '/test.jpg',
66
- uri: 'entities/1Rd2I9Mt/attributes/ImageGallery/123123/UrlThumbnail/66666'
67
- }
68
- ]
69
- },
70
- ov: true
71
- }
72
- ],
73
- attributeType: {
74
- attributes: [
75
- {
76
- name: 'UrlThumbnail',
77
- type: 'String',
78
- uri: 'configuration/entityTypes/Series/attributes/ImageGallery/attributes/UrlThumbnail'
79
- }
80
- ],
81
- name: 'ImageGallery',
82
- type: 'Image',
83
- uri: 'configuration/entityTypes/Employee/attributes/ImageGallery'
84
- },
85
- crosswalksMap: {
86
- 'entities/1Rd2I9Mt/attributes/ImageGallery/123123': [crosswalks[0]],
87
- 'entities/1Rd2I9Mt/attributes/ImageGallery/39V5GWJZv': [crosswalks[0]]
88
- },
89
- onPin: jest.fn(),
90
- onIgnore: jest.fn(),
91
- onEdit: jest.fn(),
92
- onAdd: jest.fn(),
93
- onDelete: jest.fn(),
94
- parentUri: 'entities/1Rd2I9Mt',
95
- emptyTempAttributeUris: []
96
- };
97
- var wrapper = shallow(React.createElement(ImageAttributesRenderer, __assign({}, props)));
98
- var values = wrapper.find(InlineImageAttribute);
99
- expect(values.length).toBe(2);
100
- var attributeValues = props.attributeValues, otherProps = __rest(props, ["attributeValues"]);
101
- values.forEach(function (value, index) {
102
- expect(value.props()).toEqual(__assign({ attributeValue: attributeValues[index] }, otherProps));
103
- });
104
- });
105
- });
@@ -1,106 +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 __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import React from 'react';
24
- import { shallow } from 'enzyme';
25
- import { InlineNestedAttribute } from '../../../../../InlineNestedAttribute';
26
- import { NestedAttributesRenderer } from './NestedAttributesRenderer';
27
- describe('NestedAttributesRenderer tests', function () {
28
- it('should render correctly', function () {
29
- var crosswalks = [
30
- {
31
- uri: 'entities/j8K1vc9/crosswalks/12jf9nL05',
32
- type: 'configuration/sources/Reltio',
33
- value: 'nQpZyQt',
34
- reltioLoadDate: '2021-06-11T08:24:31.726Z',
35
- createDate: '2018-11-19T12:14:00.735Z',
36
- updateDate: '2018-11-19T12:14:00.735Z',
37
- attributes: ['entities/1/attributes/Nested/1', 'entities/1/attributes/Nested/2/SubNested/1'],
38
- singleAttributeUpdateDates: {
39
- 'entities/1/attributes/Date/1': '2018-11-29T05:39:56.445Z'
40
- }
41
- }
42
- ];
43
- var props = {
44
- attributeValues: [
45
- {
46
- uri: 'entities/1/attributes/Nested/1',
47
- value: {
48
- SubNested: [
49
- {
50
- uri: 'entities/1/attributes/Nested/1/SubNested/1',
51
- type: 'String',
52
- value: '1'
53
- }
54
- ]
55
- },
56
- ov: true
57
- },
58
- {
59
- uri: 'entities/1/attributes/Nested/2',
60
- value: {
61
- SubNested: [
62
- {
63
- uri: 'entities/1/attributes/Nested/2/SubNested/1',
64
- type: 'String',
65
- value: '2'
66
- }
67
- ]
68
- },
69
- ov: true
70
- }
71
- ],
72
- attributeType: {
73
- uri: 'configuration/entityTypes/HCP/attributes/Nested',
74
- label: 'Nested',
75
- name: 'Nested',
76
- type: 'Nested',
77
- attributes: [
78
- {
79
- label: 'SubNested',
80
- name: 'SubNested',
81
- type: 'String',
82
- uri: 'configuration/entityTypes/HCP/attributes/Nested/attributes/SubNested'
83
- }
84
- ]
85
- },
86
- crosswalksMap: {
87
- 'entities/1/attributes/Nested/1': [crosswalks[0]],
88
- 'entities/1/attributes/Nested/2/SubNested/1': [crosswalks[0]]
89
- },
90
- onPin: jest.fn(),
91
- onIgnore: jest.fn(),
92
- onEdit: jest.fn(),
93
- onAdd: jest.fn(),
94
- onDelete: jest.fn(),
95
- parentUri: 'entities/1',
96
- emptyTempAttributeUris: []
97
- };
98
- var wrapper = shallow(React.createElement(NestedAttributesRenderer, __assign({}, props)));
99
- var values = wrapper.find(InlineNestedAttribute);
100
- expect(values.length).toBe(2);
101
- var attributeValues = props.attributeValues, otherProps = __rest(props, ["attributeValues"]);
102
- values.forEach(function (value, index) {
103
- expect(value.props()).toEqual(__assign({ attributeValue: attributeValues[index] }, otherProps));
104
- });
105
- });
106
- });
@@ -1,62 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { AttributeTitle } from '../../../../../AttributeTitle';
4
- import { ReadOnlyAttributeValuesBlock } from '../../../../../ReadOnlyAttributeValuesBlock';
5
- import { OvValuesRenderer } from './OvValuesRenderer';
6
- describe('OvValuesRenderer tests', function () {
7
- it('should render correctly', function () {
8
- var value = {
9
- values: [
10
- {
11
- uri: 'entities/1/attributes/CountryCode/1',
12
- type: 'configuration/entityTypes/HCP/attributes/CountryCode',
13
- value: 'Italy',
14
- lookupCode: 'IT',
15
- ov: true
16
- }
17
- ],
18
- attributeType: {
19
- uri: 'configuration/entityTypes/HCP',
20
- label: 'HCP',
21
- name: 'HCP',
22
- type: 'String',
23
- attributes: [
24
- {
25
- label: 'Country Code',
26
- name: 'CountryCode',
27
- type: 'String',
28
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
29
- }
30
- ]
31
- }
32
- };
33
- var wrapper = shallow(React.createElement(OvValuesRenderer, { value: value }));
34
- expect(wrapper.find(AttributeTitle).prop('label')).toBe('HCP');
35
- var attributesBlock = wrapper.find(ReadOnlyAttributeValuesBlock);
36
- expect(attributesBlock.prop('values')).toEqual(value.values);
37
- expect(attributesBlock.prop('attributeType')).toEqual(value.attributeType);
38
- });
39
- it('should not render attributes if ovValues are missing', function () {
40
- var value = {
41
- attributeType: {
42
- uri: 'configuration/entityTypes/HCP',
43
- label: 'HCP',
44
- name: 'HCP',
45
- type: 'String',
46
- attributes: [
47
- {
48
- label: 'Country Code',
49
- name: 'CountryCode',
50
- type: 'String',
51
- uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
52
- }
53
- ]
54
- }
55
- };
56
- var wrapper = shallow(React.createElement(OvValuesRenderer, { value: value }));
57
- expect(wrapper.find(AttributeTitle).prop('label')).toBe('HCP');
58
- var attributesBlock = wrapper.find(ReadOnlyAttributeValuesBlock);
59
- expect(attributesBlock.prop('values')).toEqual(undefined);
60
- expect(attributesBlock.prop('attributeType')).toEqual(value.attributeType);
61
- });
62
- });
@@ -1,188 +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 __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import React from 'react';
24
- import { shallow } from 'enzyme';
25
- import { InlineReferenceAttribute } from '../../../../../InlineReferenceAttribute';
26
- import { ReferenceAttributesRenderer } from './ReferenceAttributesRenderer';
27
- describe('ReferenceAttributesRenderer tests', function () {
28
- it('should render correctly', function () {
29
- var crosswalks = [
30
- {
31
- uri: 'entities/1/crosswalks/uAGtqeB.3VKnDCtBz',
32
- type: 'configuration/sources/HMS',
33
- value: 'cww2',
34
- createDate: '2020-09-02T16:19:12.943Z',
35
- updateDate: '2020-09-02T16:19:12.943Z',
36
- attributeURIs: ['entities/1/attributes/Address/1/AddressLine/1', 'entities/1/attributes/Address/1']
37
- },
38
- {
39
- uri: 'entities/1/crosswalks/uAGtuuR.3VKnDDiL5',
40
- type: 'configuration/sources/HMS',
41
- value: 'cwf2',
42
- createDate: '2020-09-02T16:19:12.943Z',
43
- updateDate: '2020-09-02T16:19:12.943Z',
44
- attributeURIs: ['entities/1/attributes/Address/2/AddressLine1/1', 'entities/1/attributes/Address/2']
45
- }
46
- ];
47
- var props = {
48
- attributeValues: [
49
- {
50
- label: 'Granada Aveue Santa Clara 1',
51
- relationshipLabel: 'Office',
52
- value: {
53
- AddressLine1: [
54
- {
55
- type: 'configuration/entityTypes/Location/attributes/AddressLine1',
56
- ov: true,
57
- value: '3588 Granada Aveue',
58
- uri: 'entities/1/attributes/Address/1/AddressLine1/1'
59
- }
60
- ]
61
- },
62
- ov: true,
63
- uri: 'entities/1/attributes/Address/1',
64
- refEntity: {
65
- type: 'configuration/entityTypes/Location',
66
- crosswalks: [
67
- {
68
- uri: 'entities/1/crosswalks/1YWdmjzf.3VKnDCovj',
69
- type: 'configuration/sources/HMS',
70
- value: 'cww1',
71
- createDate: '2020-09-02T16:19:12.943Z',
72
- updateDate: '2020-09-02T16:19:12.943Z',
73
- attributeURIs: [
74
- 'entities/1/attributes/Address/1/AddressLine1/1',
75
- 'entities/1/attributes/Address/1'
76
- ]
77
- }
78
- ],
79
- objectURI: 'entities/1'
80
- },
81
- refRelation: {
82
- type: 'configuration/relationTypes/HasAddress',
83
- crosswalks: [
84
- {
85
- uri: 'entities/1/crosswalks/uAGtqeB.3VKnDCtBz',
86
- type: 'configuration/sources/HMS',
87
- value: 'cww2',
88
- createDate: '2020-09-02T16:19:12.943Z',
89
- updateDate: '2020-09-02T16:19:12.943Z',
90
- attributeURIs: [
91
- 'entities/1/attributes/Address/1/AddressLine/1',
92
- 'entities/1/attributes/Address/1'
93
- ]
94
- }
95
- ],
96
- startRefPinned: false,
97
- endRefPinned: false,
98
- startRefIgnored: false,
99
- endRefIgnored: false,
100
- objectURI: 'relations/1'
101
- }
102
- },
103
- {
104
- label: 'Granada Aveue Santa Clara 2',
105
- relationshipLabel: 'Office',
106
- value: {
107
- AddressLine1: [
108
- {
109
- type: 'configuration/entityTypes/Location/attributes/AddressLine1',
110
- ov: true,
111
- value: '3587 Granada Aveue',
112
- uri: 'entities/1/attributes/Address/2/AddressLine1/1'
113
- }
114
- ]
115
- },
116
- ov: true,
117
- uri: 'entities/1/attributes/Address/2',
118
- refEntity: {
119
- type: 'configuration/entityTypes/Location',
120
- crosswalks: [
121
- {
122
- uri: 'entities/1/crosswalks/1YWdmsWB.3VKnDDe4p',
123
- type: 'configuration/sources/HMS',
124
- value: 'cwf1',
125
- createDate: '2020-09-02T16:19:12.943Z',
126
- updateDate: '2020-09-02T16:19:12.943Z',
127
- attributeURIs: [
128
- 'entities/1/attributes/Address/2/AddressLine1/1',
129
- 'entities/1/attributes/Address/2'
130
- ]
131
- }
132
- ],
133
- objectURI: 'entities/1'
134
- },
135
- refRelation: {
136
- type: 'configuration/relationTypes/HasAddress',
137
- crosswalks: [
138
- {
139
- uri: 'entities/1/crosswalks/uAGtuuR.3VKnDDiL5',
140
- type: 'configuration/sources/HMS',
141
- value: 'cwf2',
142
- createDate: '2020-09-02T16:19:12.943Z',
143
- updateDate: '2020-09-02T16:19:12.943Z',
144
- attributeURIs: [
145
- 'entities/1/attributes/Address/2/AddressLine1/1',
146
- 'entities/1/attributes/Address/2'
147
- ]
148
- }
149
- ],
150
- startRefPinned: false,
151
- endRefPinned: false,
152
- startRefIgnored: false,
153
- endRefIgnored: false,
154
- objectURI: 'relations/2'
155
- }
156
- }
157
- ],
158
- attributeType: {
159
- label: 'Address',
160
- name: 'Address',
161
- type: 'Reference',
162
- uri: 'configuration/entityTypes/HCP/attributes/Address',
163
- referencedAttributeURIs: ['configuration/entityTypes/Location/attributes/AddressLine1'],
164
- relationshipTypeURI: 'configuration/relationTypes/HasAddress'
165
- },
166
- crosswalksMap: {
167
- 'entities/1/attributes/Address/1': [crosswalks[0]],
168
- 'entities/1/attributes/Address/1/AddressLine1/1': [crosswalks[0]],
169
- 'entities/1/attributes/Address/2': [crosswalks[1]],
170
- 'entities/1/attributes/Address/2/AddressLine1/1': [crosswalks[1]]
171
- },
172
- onPin: jest.fn(),
173
- onIgnore: jest.fn(),
174
- onEdit: jest.fn(),
175
- onAdd: jest.fn(),
176
- onDelete: jest.fn(),
177
- parentUri: 'entities/1',
178
- emptyTempAttributeUris: []
179
- };
180
- var wrapper = shallow(React.createElement(ReferenceAttributesRenderer, __assign({}, props)));
181
- var values = wrapper.find(InlineReferenceAttribute);
182
- expect(values.length).toBe(2);
183
- var attributeValues = props.attributeValues, otherProps = __rest(props, ["attributeValues"]);
184
- values.forEach(function (value, index) {
185
- expect(value.props()).toEqual(__assign({ attributeValue: attributeValues[index] }, otherProps));
186
- });
187
- });
188
- });
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import InfoIcon from '@mui/icons-material/Info';
4
- import { SmallIconButtonWithTooltip } from '../../../../../SmallIconButton';
5
- import { RuleTypeInfoButton } from './RuleTypeInfoButton';
6
- describe('RuleTypeInfoButton tests', function () {
7
- it('should render correctly', function () {
8
- var info = {
9
- sourcesUriOrder: ['configuration/sources/CGD', 'configuration/sources/DNO']
10
- };
11
- var wrapper = shallow(React.createElement(RuleTypeInfoButton, { info: info }));
12
- expect(wrapper.find(SmallIconButtonWithTooltip).props()).toMatchObject({
13
- icon: InfoIcon,
14
- tooltipTitle: 'View details'
15
- });
16
- });
17
- });
@@ -1,53 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { RuleTypeRenderer } from './RuleTypeRenderer';
4
- import { RuleTypeInfoButton } from '../RuleTypeInfoButton';
5
- describe('RuleTypeRenderer tests', function () {
6
- it('should render simple rule correctly', function () {
7
- var value = {
8
- ruleType: {
9
- uri: 'configuration/survivorshipStrategies/LUD',
10
- label: 'Recency'
11
- }
12
- };
13
- var wrapper = shallow(React.createElement(RuleTypeRenderer, { value: value }));
14
- expect(wrapper.find('.label').text()).toBe('Recency');
15
- expect(wrapper.find(RuleTypeInfoButton).length).toBe(0);
16
- });
17
- it('should render correctly if it has sourcesUriOrder prop', function () {
18
- var value = {
19
- ruleType: {
20
- uri: 'configuration/survivorshipStrategies/SRC_SYS',
21
- label: 'Source system'
22
- },
23
- sourcesUriOrder: ['configuration/sources/CGD', 'configuration/sources/DNO']
24
- };
25
- var wrapper = shallow(React.createElement(RuleTypeRenderer, { value: value }));
26
- expect(wrapper.find('.label').text()).toBe('Source system');
27
- expect(wrapper.find(RuleTypeInfoButton).length).toBe(1);
28
- });
29
- it('should render correctly if it has primaryAttributeUri prop', function () {
30
- var value = {
31
- ruleType: {
32
- uri: 'configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk',
33
- label: 'Other Attribute Winner Crosswalk'
34
- },
35
- primaryAttributeUri: 'configuration/entityTypes/HCP/attributes/CountryCode'
36
- };
37
- var wrapper = shallow(React.createElement(RuleTypeRenderer, { value: value }));
38
- expect(wrapper.find('.label').text()).toBe('Other Attribute Winner Crosswalk');
39
- expect(wrapper.find(RuleTypeInfoButton).length).toBe(1);
40
- });
41
- it('should render correctly if it has comparisonAttributeUri prop', function () {
42
- var value = {
43
- ruleType: {
44
- uri: 'configuration/survivorshipStrategies/MinValue',
45
- label: 'Minimum value'
46
- },
47
- comparisonAttributeUri: 'configuration/relationTypes/HasAddress/attributes/Status'
48
- };
49
- var wrapper = shallow(React.createElement(RuleTypeRenderer, { value: value }));
50
- expect(wrapper.find('.label').text()).toBe('Minimum value');
51
- expect(wrapper.find(RuleTypeInfoButton).length).toBe(1);
52
- });
53
- });