@reltio/components 1.4.1905 → 1.4.1907

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 (105) hide show
  1. package/cjs/ActionsPanel/ActionsPanel.test.js +133 -49
  2. package/cjs/AttributeListItem/AttributeListItem.spec.js +147 -118
  3. package/cjs/AttributeSelector/AttributeSelector.specs.js +125 -193
  4. package/cjs/AttributesErrorsPanel/AttributesErrorsPanel.specs.js +128 -71
  5. package/cjs/AttributesErrorsPanel/components/Error/Error.specs.js +96 -90
  6. package/cjs/AttributesErrorsPanel/store.test-data.d.ts +22 -0
  7. package/cjs/AttributesErrorsPanel/store.test-data.js +29 -0
  8. package/cjs/AttributesFilterSelector/AttributesFilterSelector.test.js +127 -105
  9. package/cjs/AttributesFiltersButton/AttributesFiltersButton.test.js +218 -136
  10. package/cjs/AttributesValuesEditor/AttributesValuesEditor.test.js +92 -88
  11. package/cjs/AttributesView/AttributesView.test.js +67 -34
  12. package/cjs/AutoSizeList/AutoSizeList.test.js +81 -59
  13. package/cjs/{ActionsPanel/components/MenuItemRenderer/MenuItemRenderer.spec.js → AvatarWithFallback/AvatarWithFallback.test.js} +15 -31
  14. package/cjs/BarChart/BarChart.test.js +128 -65
  15. package/cjs/BasicAttributeSelector/BasicAttributeSelector.spec.js +27 -10
  16. package/cjs/BasicViewContent/BasicViewContent.test.js +7 -9
  17. package/cjs/BlobRenderer/BlobRenderer.test.js +28 -9
  18. package/cjs/BooleanRadioEditor/BooleanRadioEditor.test.js +89 -35
  19. package/cjs/BubbleChart/BubbleChart.test.js +111 -87
  20. package/cjs/CloudChart/CloudChart.test.js +95 -36
  21. package/cjs/CollaborationItem/CollaborationItem.test.js +67 -30
  22. package/cjs/CollaborationItem/components/Comment/Comment.test.js +221 -189
  23. package/cjs/CollaborationItem/components/CommentContent/CommentContent.test.js +46 -81
  24. package/cjs/CollaborationItem/components/RepliedComment/RepliedComment.test.js +194 -163
  25. package/cjs/CollaborationItem/components/SendMessageArea/SendMessageArea.test.js +307 -266
  26. package/cjs/CollapseButton/CollapseButton.test.js +74 -15
  27. package/cjs/CollapseRowButton/CollapseRowButton.test.js +82 -24
  28. package/cjs/ColorBar/ColorBar.test.js +13 -15
  29. package/cjs/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.spec.js +207 -129
  30. package/cjs/CommentsContainer/CommentsContainer.test.js +282 -211
  31. package/cjs/CommentsContainer/components/CollaborationPopup/CollaborationPopup.test.js +183 -122
  32. package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.test.js +42 -41
  33. package/cjs/ConfirmDeleteDialog/ConfirmDeleteDialog.test.js +77 -28
  34. package/cjs/ConfirmationDialog/ConfirmationDialog.test.js +85 -48
  35. package/cjs/ConnectionEditor/ConnectionEditor.test.js +299 -282
  36. package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +3 -1
  37. package/cjs/ReactSortableTree/ReactSortableTree.js +2 -7
  38. package/cjs/RelationTypeSelector/RelationTypeSelector.d.ts +3 -1
  39. package/cjs/types/index.d.ts +1 -1
  40. package/esm/ActionsPanel/ActionsPanel.test.js +133 -49
  41. package/esm/AttributeListItem/AttributeListItem.spec.js +149 -97
  42. package/esm/AttributeSelector/AttributeSelector.specs.js +125 -193
  43. package/esm/AttributesErrorsPanel/AttributesErrorsPanel.specs.js +128 -71
  44. package/esm/AttributesErrorsPanel/components/Error/Error.specs.js +98 -72
  45. package/esm/AttributesErrorsPanel/store.test-data.d.ts +22 -0
  46. package/esm/AttributesErrorsPanel/store.test-data.js +26 -0
  47. package/esm/AttributesFilterSelector/AttributesFilterSelector.test.js +129 -84
  48. package/esm/AttributesFiltersButton/AttributesFiltersButton.test.js +218 -136
  49. package/esm/AttributesValuesEditor/AttributesValuesEditor.test.js +94 -67
  50. package/esm/AttributesView/AttributesView.test.js +67 -34
  51. package/esm/AutoSizeList/AutoSizeList.test.js +81 -59
  52. package/esm/{ActionsPanel/components/MenuItemRenderer/MenuItemRenderer.spec.js → AvatarWithFallback/AvatarWithFallback.test.js} +16 -32
  53. package/esm/BarChart/BarChart.test.js +128 -65
  54. package/esm/BasicAttributeSelector/BasicAttributeSelector.spec.js +27 -10
  55. package/esm/BasicViewContent/BasicViewContent.test.js +7 -9
  56. package/esm/BlobRenderer/BlobRenderer.test.js +28 -9
  57. package/esm/BooleanRadioEditor/BooleanRadioEditor.test.js +89 -35
  58. package/esm/BubbleChart/BubbleChart.test.js +111 -87
  59. package/esm/CloudChart/CloudChart.test.js +95 -36
  60. package/esm/CollaborationItem/CollaborationItem.test.js +67 -30
  61. package/esm/CollaborationItem/components/Comment/Comment.test.js +221 -189
  62. package/esm/CollaborationItem/components/CommentContent/CommentContent.test.js +46 -58
  63. package/esm/CollaborationItem/components/RepliedComment/RepliedComment.test.js +194 -163
  64. package/esm/CollaborationItem/components/SendMessageArea/SendMessageArea.test.js +307 -266
  65. package/esm/CollapseButton/CollapseButton.test.js +74 -15
  66. package/esm/CollapseRowButton/CollapseRowButton.test.js +82 -24
  67. package/esm/ColorBar/ColorBar.test.js +13 -15
  68. package/esm/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.spec.js +207 -129
  69. package/esm/CommentsContainer/CommentsContainer.test.js +282 -211
  70. package/esm/CommentsContainer/components/CollaborationPopup/CollaborationPopup.test.js +182 -101
  71. package/esm/ConfigureColumnsPopup/ConfigureColumnsPopup.test.js +42 -41
  72. package/esm/ConfirmDeleteDialog/ConfirmDeleteDialog.test.js +77 -28
  73. package/esm/ConfirmationDialog/ConfirmationDialog.test.js +85 -48
  74. package/esm/ConnectionEditor/ConnectionEditor.test.js +300 -283
  75. package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +3 -1
  76. package/esm/ReactSortableTree/ReactSortableTree.js +2 -7
  77. package/esm/RelationTypeSelector/RelationTypeSelector.d.ts +3 -1
  78. package/esm/types/index.d.ts +1 -1
  79. package/package.json +2 -2
  80. package/cjs/AttributesErrorsPanel/components/ErrorsPanel/ErrorsPanel.specs.js +0 -100
  81. package/cjs/AttributesFiltersButton/components/ActionButtons/ActionButtons.test.d.ts +0 -1
  82. package/cjs/AttributesFiltersButton/components/ActionButtons/ActionButtons.test.js +0 -46
  83. package/cjs/AvatarWithFallback/AvatarWithFallback.specs.d.ts +0 -1
  84. package/cjs/AvatarWithFallback/AvatarWithFallback.specs.js +0 -27
  85. package/cjs/BooleanRadioEditor/components/BooleanEditor/BooleanEditor.test.d.ts +0 -1
  86. package/cjs/BooleanRadioEditor/components/BooleanEditor/BooleanEditor.test.js +0 -27
  87. package/cjs/CollaborationItem/components/Avatar/Avatar.test.d.ts +0 -1
  88. package/cjs/CollaborationItem/components/Avatar/Avatar.test.js +0 -15
  89. package/cjs/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.test.d.ts +0 -1
  90. package/cjs/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.test.js +0 -80
  91. package/esm/ActionsPanel/components/MenuItemRenderer/MenuItemRenderer.spec.d.ts +0 -1
  92. package/esm/AttributesErrorsPanel/components/ErrorsPanel/ErrorsPanel.specs.d.ts +0 -1
  93. package/esm/AttributesErrorsPanel/components/ErrorsPanel/ErrorsPanel.specs.js +0 -95
  94. package/esm/AttributesFiltersButton/components/ActionButtons/ActionButtons.test.d.ts +0 -1
  95. package/esm/AttributesFiltersButton/components/ActionButtons/ActionButtons.test.js +0 -41
  96. package/esm/AvatarWithFallback/AvatarWithFallback.specs.d.ts +0 -1
  97. package/esm/AvatarWithFallback/AvatarWithFallback.specs.js +0 -22
  98. package/esm/BooleanRadioEditor/components/BooleanEditor/BooleanEditor.test.d.ts +0 -1
  99. package/esm/BooleanRadioEditor/components/BooleanEditor/BooleanEditor.test.js +0 -22
  100. package/esm/CollaborationItem/components/Avatar/Avatar.test.d.ts +0 -1
  101. package/esm/CollaborationItem/components/Avatar/Avatar.test.js +0 -10
  102. package/esm/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.test.d.ts +0 -1
  103. package/esm/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.test.js +0 -55
  104. /package/cjs/{ActionsPanel/components/MenuItemRenderer/MenuItemRenderer.spec.d.ts → AvatarWithFallback/AvatarWithFallback.test.d.ts} +0 -0
  105. /package/{cjs/AttributesErrorsPanel/components/ErrorsPanel/ErrorsPanel.specs.d.ts → esm/AvatarWithFallback/AvatarWithFallback.test.d.ts} +0 -0
@@ -1,55 +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, * as react from 'react';
13
- import { shallow } from 'enzyme';
14
- import { MentionsInput, Mention } from 'react-mentions';
15
- import { TextFieldWithMentions } from './TextFieldWithMentions';
16
- jest.mock('react', function () { return (__assign(__assign({}, jest.requireActual('react')), { useContext: jest.fn().mockImplementation(function (f) { return f(); }) })); });
17
- var users = [{ username: 'vyacheslav' }, { username: 'eugeniy' }];
18
- describe('TextFieldWithMentions tests', function () {
19
- beforeAll(function () {
20
- jest.spyOn(react, 'useContext').mockImplementation(function () { return users; });
21
- });
22
- it('should render main parts correctly', function () {
23
- var component = shallow(React.createElement(TextFieldWithMentions, null));
24
- expect(component.find(MentionsInput)).toHaveLength(1);
25
- expect(component.find(Mention)).toHaveLength(1);
26
- });
27
- it('should pass users to Mention component correctly', function () {
28
- var component = shallow(React.createElement(TextFieldWithMentions, null));
29
- expect(component.find(Mention).prop('data')).toEqual([
30
- { display: 'vyacheslav', id: 'vyacheslav' },
31
- { display: 'eugeniy', id: 'eugeniy' }
32
- ]);
33
- });
34
- it('should pass all props to MentionsInput component correctly', function () {
35
- var props = {
36
- value: 'value',
37
- placeholder: 'placeholder',
38
- disabled: false
39
- };
40
- var component = shallow(React.createElement(TextFieldWithMentions, __assign({}, props)));
41
- expect(component.find(MentionsInput).props()).toMatchObject({
42
- value: 'value',
43
- placeholder: 'placeholder',
44
- disabled: false
45
- });
46
- });
47
- it('handleChange handler should work correctly', function () {
48
- var onChange = jest.fn();
49
- var component = shallow(React.createElement(TextFieldWithMentions, { onChange: onChange }));
50
- component
51
- .find(MentionsInput)
52
- .simulate('change', null, 'Hello @[+username](username) and @[+username](username)', 'Hello +username and +username', [{ display: '+username' }, { display: '+username' }]);
53
- expect(onChange).toHaveBeenCalledWith('Hello @[+username](username) and @[+username](username)', 'Hello +username and +username', ['username']);
54
- });
55
- });