orc-shared 5.9.0-dev.15 → 5.9.0-dev.18
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/MaterialUI/Inputs/Switch.js +17 -1
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +2 -0
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +8 -0
- package/dist/hooks/useMultipleFieldEditState.js +12 -3
- package/package.json +1 -1
- package/src/components/MaterialUI/Inputs/Switch.js +22 -1
- package/src/components/MaterialUI/Inputs/Switch.test.js +23 -0
- package/src/components/MaterialUI/Inputs/SwitchProps.js +2 -0
- package/src/components/MaterialUI/Inputs/SwitchProps.test.js +2 -0
- package/src/components/MaterialUI/Navigation/DropDownMenu.js +8 -0
- package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +24 -0
- package/src/hooks/useMultipleFieldEditState.js +11 -4
- package/src/hooks/useMultipleFieldEditState.test.js +49 -1
|
@@ -116,6 +116,16 @@ var useStyles = exports.useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
116
116
|
"& + $track": {
|
|
117
117
|
backgroundColor: "".concat(theme.palette.grey.borders, " !important")
|
|
118
118
|
}
|
|
119
|
+
},
|
|
120
|
+
container: {
|
|
121
|
+
display: "flex",
|
|
122
|
+
flexDirection: "column"
|
|
123
|
+
},
|
|
124
|
+
errorText: {
|
|
125
|
+
marginTop: theme.spacing(0.5),
|
|
126
|
+
color: theme.palette.error.main,
|
|
127
|
+
fontSize: theme.typography.fieldLabelSize,
|
|
128
|
+
float: "left"
|
|
119
129
|
}
|
|
120
130
|
};
|
|
121
131
|
});
|
|
@@ -130,6 +140,7 @@ var Switch = function Switch(_ref) {
|
|
|
130
140
|
var value = (switchProps == null ? void 0 : switchProps.get(_SwitchProps.default.propNames.value)) || false;
|
|
131
141
|
var onCaption = switchProps == null ? void 0 : switchProps.get(_SwitchProps.default.propNames.onCaption);
|
|
132
142
|
var offCaption = switchProps == null ? void 0 : switchProps.get(_SwitchProps.default.propNames.offCaption);
|
|
143
|
+
var error = switchProps == null ? void 0 : switchProps.get(_SwitchProps.default.propNames.error);
|
|
133
144
|
var disabled = (switchProps == null ? void 0 : switchProps.get(_SwitchProps.default.propNames.disabled)) || false;
|
|
134
145
|
var readOnly = switchProps == null ? void 0 : switchProps.get(_SwitchProps.default.propNames.readOnly);
|
|
135
146
|
var className = (switchProps == null ? void 0 : switchProps.get(_SwitchProps.default.propNames.className)) || "";
|
|
@@ -149,7 +160,7 @@ var Switch = function Switch(_ref) {
|
|
|
149
160
|
checked: classes.checked,
|
|
150
161
|
disabled: classes.disabled
|
|
151
162
|
}, className);
|
|
152
|
-
|
|
163
|
+
var switchComponent = /*#__PURE__*/_react.default.createElement(_Switch.default, {
|
|
153
164
|
disabled: disabled,
|
|
154
165
|
classes: switchClasses,
|
|
155
166
|
checked: value,
|
|
@@ -158,6 +169,11 @@ var Switch = function Switch(_ref) {
|
|
|
158
169
|
},
|
|
159
170
|
color: "primary"
|
|
160
171
|
});
|
|
172
|
+
return error && /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
+
className: classes.container
|
|
174
|
+
}, switchComponent, /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
+
className: (0, _classnames.default)(classes.errorText)
|
|
176
|
+
}, error)) || switchComponent;
|
|
161
177
|
};
|
|
162
178
|
__signature__(Switch, "useIntl{{ formatMessage }}\nuseStyles{classes}", function () {
|
|
163
179
|
return [_reactIntl.useIntl, useStyles];
|
|
@@ -35,6 +35,7 @@ var SwitchProps = /*#__PURE__*/function (_ComponentProps) {
|
|
|
35
35
|
_this.componentProps.set(_this.constructor.propNames.readOnly, null);
|
|
36
36
|
_this.componentProps.set(_this.constructor.propNames.className, null);
|
|
37
37
|
_this.componentProps.set(_this.constructor.propNames.id, null);
|
|
38
|
+
_this.componentProps.set(_this.constructor.propNames.error, null);
|
|
38
39
|
_this.componentProps.set(_this.constructor.propNames.metadata, null);
|
|
39
40
|
_this._isSwitchProps = true;
|
|
40
41
|
return _this;
|
|
@@ -57,6 +58,7 @@ _defineProperty(SwitchProps, "propNames", {
|
|
|
57
58
|
readOnly: "readOnly",
|
|
58
59
|
className: "className",
|
|
59
60
|
id: "id",
|
|
61
|
+
error: "error",
|
|
60
62
|
metadata: "metadata"
|
|
61
63
|
});
|
|
62
64
|
var isSwitchProps = exports.isSwitchProps = function isSwitchProps(value) {
|
|
@@ -78,6 +78,13 @@ var DropDownMenu = function DropDownMenu(_ref) {
|
|
|
78
78
|
event.stopPropagation();
|
|
79
79
|
setAnchorEl(null);
|
|
80
80
|
};
|
|
81
|
+
|
|
82
|
+
// Even though we do nothing, we need to avoid mouse event propagation when the mouse
|
|
83
|
+
// button is released after hovering out the menu
|
|
84
|
+
var onMainMenuClick = function onMainMenuClick(event) {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
event.stopPropagation();
|
|
87
|
+
};
|
|
81
88
|
var onMenuItemClick = function onMenuItemClick(action, itemContext) {
|
|
82
89
|
return function (event) {
|
|
83
90
|
onClose(event);
|
|
@@ -110,6 +117,7 @@ var DropDownMenu = function DropDownMenu(_ref) {
|
|
|
110
117
|
},
|
|
111
118
|
id: "scope-menu",
|
|
112
119
|
open: isOpened,
|
|
120
|
+
onClick: onMainMenuClick,
|
|
113
121
|
onClose: onClose,
|
|
114
122
|
autoFocus: autoFocus,
|
|
115
123
|
anchorEl: anchorEl
|
|
@@ -49,11 +49,14 @@ var useMultipleFieldEditState = function useMultipleFieldEditState(entityId, sec
|
|
|
49
49
|
var dispatch = (0, _useDispatchWithModulesData.useDispatchWithModulesData)();
|
|
50
50
|
var mergedValidationRules = _objectSpread(_objectSpread({}, _modelValidationHelper.validationRules), extendedValidationRules);
|
|
51
51
|
var modifiedStates = (0, _reactRedux.useSelector)((0, _view.getModifiedModels)(entityId))[sectionName] || {};
|
|
52
|
-
var useDynamicFieldState = function useDynamicFieldState(id, fieldName, errorTypes) {
|
|
52
|
+
var useDynamicFieldState = function useDynamicFieldState(id, fieldName, errorTypes, fieldDependencies) {
|
|
53
53
|
var _initialValues$id$fie, _initialValues$id, _modifiedStates$id$fi, _modifiedStates$id, _editState$value;
|
|
54
54
|
if (errorTypes === void 0) {
|
|
55
55
|
errorTypes = [];
|
|
56
56
|
}
|
|
57
|
+
if (fieldDependencies === void 0) {
|
|
58
|
+
fieldDependencies = {};
|
|
59
|
+
}
|
|
57
60
|
var keys = [id, fieldName];
|
|
58
61
|
var initialValue = (_initialValues$id$fie = (_initialValues$id = initialValues[id]) == null ? void 0 : _initialValues$id[fieldName]) != null ? _initialValues$id$fie : "";
|
|
59
62
|
var editState = (_modifiedStates$id$fi = (_modifiedStates$id = modifiedStates[id]) == null ? void 0 : _modifiedStates$id[fieldName]) != null ? _modifiedStates$id$fi : {};
|
|
@@ -65,17 +68,23 @@ var useMultipleFieldEditState = function useMultipleFieldEditState(entityId, sec
|
|
|
65
68
|
var resetEditState = function resetEditState() {
|
|
66
69
|
dispatch(_view2.setEditModelField, [keys, initialValue, initialValue, entityId, sectionName]);
|
|
67
70
|
};
|
|
68
|
-
var isEditStateValid = function isEditStateValid(value) {
|
|
71
|
+
var isEditStateValid = function isEditStateValid(value, dependencies) {
|
|
72
|
+
if (dependencies === void 0) {
|
|
73
|
+
dependencies = {};
|
|
74
|
+
}
|
|
69
75
|
var valueToValidate = value != null ? value : editState.value;
|
|
70
76
|
var hasAnyValidationErrors = false;
|
|
71
77
|
errorTypes.forEach(function (errorType) {
|
|
72
|
-
var isValid = mergedValidationRules[errorType](valueToValidate, id, fieldName);
|
|
78
|
+
var isValid = mergedValidationRules[errorType](valueToValidate, id, fieldName, _objectSpread(_objectSpread({}, fieldDependencies), dependencies));
|
|
73
79
|
if (isValid === false) {
|
|
74
80
|
dispatch(_view2.setEditModelFieldError, [keys, errorType, entityId, sectionName]);
|
|
75
81
|
hasAnyValidationErrors = true;
|
|
76
82
|
return;
|
|
77
83
|
}
|
|
78
84
|
});
|
|
85
|
+
if (!hasAnyValidationErrors) {
|
|
86
|
+
dispatch(_view2.removeEditModelFieldError, [keys, entityId, sectionName]);
|
|
87
|
+
}
|
|
79
88
|
return !hasAnyValidationErrors;
|
|
80
89
|
};
|
|
81
90
|
return {
|
package/package.json
CHANGED
|
@@ -87,6 +87,16 @@ export const useStyles = makeStyles(theme => ({
|
|
|
87
87
|
backgroundColor: `${theme.palette.grey.borders} !important`,
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
|
+
container: {
|
|
91
|
+
display: "flex",
|
|
92
|
+
flexDirection: "column",
|
|
93
|
+
},
|
|
94
|
+
errorText: {
|
|
95
|
+
marginTop: theme.spacing(0.5),
|
|
96
|
+
color: theme.palette.error.main,
|
|
97
|
+
fontSize: theme.typography.fieldLabelSize,
|
|
98
|
+
float: "left",
|
|
99
|
+
},
|
|
90
100
|
}));
|
|
91
101
|
|
|
92
102
|
const Switch = ({ switchProps }) => {
|
|
@@ -100,6 +110,7 @@ const Switch = ({ switchProps }) => {
|
|
|
100
110
|
const value = switchProps?.get(SwitchProps.propNames.value) || false;
|
|
101
111
|
const onCaption = switchProps?.get(SwitchProps.propNames.onCaption);
|
|
102
112
|
const offCaption = switchProps?.get(SwitchProps.propNames.offCaption);
|
|
113
|
+
const error = switchProps?.get(SwitchProps.propNames.error);
|
|
103
114
|
const disabled = switchProps?.get(SwitchProps.propNames.disabled) || false;
|
|
104
115
|
const readOnly = switchProps?.get(SwitchProps.propNames.readOnly);
|
|
105
116
|
const className = switchProps?.get(SwitchProps.propNames.className) || "";
|
|
@@ -120,7 +131,7 @@ const Switch = ({ switchProps }) => {
|
|
|
120
131
|
...className,
|
|
121
132
|
};
|
|
122
133
|
|
|
123
|
-
|
|
134
|
+
const switchComponent = (
|
|
124
135
|
<SwitchMui
|
|
125
136
|
disabled={disabled}
|
|
126
137
|
classes={switchClasses}
|
|
@@ -129,6 +140,16 @@ const Switch = ({ switchProps }) => {
|
|
|
129
140
|
color={"primary"}
|
|
130
141
|
/>
|
|
131
142
|
);
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
(error && (
|
|
146
|
+
<div className={classes.container}>
|
|
147
|
+
{switchComponent}
|
|
148
|
+
<div className={classNames(classes.errorText)}>{error}</div>
|
|
149
|
+
</div>
|
|
150
|
+
)) ||
|
|
151
|
+
switchComponent
|
|
152
|
+
);
|
|
132
153
|
};
|
|
133
154
|
|
|
134
155
|
export default Switch;
|
|
@@ -60,6 +60,29 @@ describe("Switch Component", () => {
|
|
|
60
60
|
expect(mountedComponent.containsMatchingElement(expected), "to be truthy");
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
+
it("Renders Switch component with an error", () => {
|
|
64
|
+
const switchProps = new SwitchProps();
|
|
65
|
+
|
|
66
|
+
switchProps.set(SwitchProps.propNames.update, update);
|
|
67
|
+
switchProps.set(SwitchProps.propNames.value, true);
|
|
68
|
+
switchProps.set(SwitchProps.propNames.error, "an error");
|
|
69
|
+
switchProps.set(SwitchProps.propNames.onCaption, { id: "captionOn" });
|
|
70
|
+
switchProps.set(SwitchProps.propNames.offCaption, { id: "captionOff" });
|
|
71
|
+
|
|
72
|
+
const component = (
|
|
73
|
+
<IntlProvider messages={messages} locale="en-US">
|
|
74
|
+
<Switch switchProps={switchProps} />
|
|
75
|
+
</IntlProvider>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const mountedComponent = mount(component);
|
|
79
|
+
const expectedSwitch = <SwitchMUI checked={true} />;
|
|
80
|
+
const expectedError = <div>an error</div>;
|
|
81
|
+
|
|
82
|
+
expect(mountedComponent.containsMatchingElement(expectedSwitch), "to be truthy");
|
|
83
|
+
expect(mountedComponent.containsMatchingElement(expectedError), "to be truthy");
|
|
84
|
+
});
|
|
85
|
+
|
|
63
86
|
it("Checkbox component handles check", () => {
|
|
64
87
|
const switchProps = new SwitchProps();
|
|
65
88
|
|
|
@@ -10,6 +10,7 @@ class SwitchProps extends ComponentProps {
|
|
|
10
10
|
readOnly: "readOnly",
|
|
11
11
|
className: "className",
|
|
12
12
|
id: "id",
|
|
13
|
+
error: "error",
|
|
13
14
|
metadata: "metadata",
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -23,6 +24,7 @@ class SwitchProps extends ComponentProps {
|
|
|
23
24
|
this.componentProps.set(this.constructor.propNames.readOnly, null);
|
|
24
25
|
this.componentProps.set(this.constructor.propNames.className, null);
|
|
25
26
|
this.componentProps.set(this.constructor.propNames.id, null);
|
|
27
|
+
this.componentProps.set(this.constructor.propNames.error, null);
|
|
26
28
|
this.componentProps.set(this.constructor.propNames.metadata, null);
|
|
27
29
|
|
|
28
30
|
this._isSwitchProps = true;
|
|
@@ -47,6 +47,13 @@ const DropDownMenu = ({ payload, menuItems, children, dropDownMenuProps = new Dr
|
|
|
47
47
|
setAnchorEl(null);
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
// Even though we do nothing, we need to avoid mouse event propagation when the mouse
|
|
51
|
+
// button is released after hovering out the menu
|
|
52
|
+
const onMainMenuClick = event => {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
event.stopPropagation();
|
|
55
|
+
};
|
|
56
|
+
|
|
50
57
|
const onMenuItemClick = (action, itemContext) => event => {
|
|
51
58
|
onClose(event);
|
|
52
59
|
action(payload, itemContext);
|
|
@@ -76,6 +83,7 @@ const DropDownMenu = ({ payload, menuItems, children, dropDownMenuProps = new Dr
|
|
|
76
83
|
classes={{ paper: classes.menu }}
|
|
77
84
|
id="scope-menu"
|
|
78
85
|
open={isOpened}
|
|
86
|
+
onClick={onMainMenuClick}
|
|
79
87
|
onClose={onClose}
|
|
80
88
|
autoFocus={autoFocus}
|
|
81
89
|
anchorEl={anchorEl}
|
|
@@ -8,6 +8,7 @@ import Icon from "../DataDisplay/Icon";
|
|
|
8
8
|
import DropDownMenu from "./DropDownMenu";
|
|
9
9
|
import { ignoreConsoleError } from "../../../utils/testUtils";
|
|
10
10
|
import { TestWrapper, createMuiTheme } from "./../../../utils/testUtils";
|
|
11
|
+
import Menu from "@material-ui/core/Menu";
|
|
11
12
|
|
|
12
13
|
describe("DropDownMenu", () => {
|
|
13
14
|
let store, menuItems, container;
|
|
@@ -92,4 +93,27 @@ describe("DropDownMenu", () => {
|
|
|
92
93
|
expect(menuItems[0].action, "to have calls satisfying", [{ args: [payload, "aContext"] }]);
|
|
93
94
|
expect(menuItems[1].action, "to have calls satisfying", [{ args: [payload, "myContext"] }]);
|
|
94
95
|
});
|
|
96
|
+
|
|
97
|
+
it("should handle onClick event on the menu", () => {
|
|
98
|
+
const payload = "payload";
|
|
99
|
+
|
|
100
|
+
const component = (
|
|
101
|
+
<Provider store={store}>
|
|
102
|
+
<DropDownMenu payload={payload} menuItems={menuItems} />
|
|
103
|
+
</Provider>
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const mountedComponent = mount(component);
|
|
107
|
+
|
|
108
|
+
const event = {
|
|
109
|
+
preventDefault: sinon.spy().named("preventDefault"),
|
|
110
|
+
stopPropagation: sinon.spy().named("stopPropagation"),
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const dropDownMenu = mountedComponent.find(Menu).at(0);
|
|
114
|
+
dropDownMenu.invoke("onClick")(event);
|
|
115
|
+
|
|
116
|
+
expect(event.preventDefault, "was called");
|
|
117
|
+
expect(event.stopPropagation, "was called");
|
|
118
|
+
});
|
|
95
119
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSelector } from "react-redux";
|
|
2
2
|
import { validationRules } from "../utils/modelValidationHelper";
|
|
3
3
|
import { getModifiedModels } from "../selectors/view";
|
|
4
|
-
import { setEditModelField, setEditModelFieldError } from "../actions/view";
|
|
4
|
+
import { setEditModelField, setEditModelFieldError, removeEditModelFieldError } from "../actions/view";
|
|
5
5
|
import { useDispatchWithModulesData } from "./../hooks/useDispatchWithModulesData";
|
|
6
6
|
|
|
7
7
|
/* This hook is used when a component has a dynamic number of fields that can be edited (e.g.: Orders' Custom Configuration Parameters).
|
|
@@ -25,7 +25,7 @@ const useMultipleFieldEditState = (entityId, sectionName, initialValues, extende
|
|
|
25
25
|
const mergedValidationRules = { ...validationRules, ...extendedValidationRules };
|
|
26
26
|
const modifiedStates = useSelector(getModifiedModels(entityId))[sectionName] || {};
|
|
27
27
|
|
|
28
|
-
const useDynamicFieldState = (id, fieldName, errorTypes = []) => {
|
|
28
|
+
const useDynamicFieldState = (id, fieldName, errorTypes = [], fieldDependencies = {}) => {
|
|
29
29
|
const keys = [id, fieldName];
|
|
30
30
|
|
|
31
31
|
const initialValue = initialValues[id]?.[fieldName] ?? "";
|
|
@@ -42,12 +42,15 @@ const useMultipleFieldEditState = (entityId, sectionName, initialValues, extende
|
|
|
42
42
|
dispatch(setEditModelField, [keys, initialValue, initialValue, entityId, sectionName]);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const isEditStateValid = value => {
|
|
45
|
+
const isEditStateValid = (value, dependencies = {}) => {
|
|
46
46
|
const valueToValidate = value ?? editState.value;
|
|
47
47
|
|
|
48
48
|
let hasAnyValidationErrors = false;
|
|
49
49
|
errorTypes.forEach(errorType => {
|
|
50
|
-
const isValid = mergedValidationRules[errorType](valueToValidate, id, fieldName
|
|
50
|
+
const isValid = mergedValidationRules[errorType](valueToValidate, id, fieldName, {
|
|
51
|
+
...fieldDependencies,
|
|
52
|
+
...dependencies,
|
|
53
|
+
});
|
|
51
54
|
|
|
52
55
|
if (isValid === false) {
|
|
53
56
|
dispatch(setEditModelFieldError, [keys, errorType, entityId, sectionName]);
|
|
@@ -57,6 +60,10 @@ const useMultipleFieldEditState = (entityId, sectionName, initialValues, extende
|
|
|
57
60
|
}
|
|
58
61
|
});
|
|
59
62
|
|
|
63
|
+
if (!hasAnyValidationErrors) {
|
|
64
|
+
dispatch(removeEditModelFieldError, [keys, entityId, sectionName]);
|
|
65
|
+
}
|
|
66
|
+
|
|
60
67
|
return !hasAnyValidationErrors;
|
|
61
68
|
};
|
|
62
69
|
|
|
@@ -5,7 +5,7 @@ import Immutable from "immutable";
|
|
|
5
5
|
import sinon from "sinon";
|
|
6
6
|
import { mount } from "enzyme";
|
|
7
7
|
import * as useDispatchWithModulesDataMock from "./useDispatchWithModulesData";
|
|
8
|
-
import { setEditModelField, setEditModelFieldError } from "./../actions/view";
|
|
8
|
+
import { removeEditModelFieldError, setEditModelField, setEditModelFieldError } from "./../actions/view";
|
|
9
9
|
import { validationErrorTypes } from "./../constants";
|
|
10
10
|
import _ from "lodash";
|
|
11
11
|
|
|
@@ -404,6 +404,54 @@ describe("useMultipleFieldEditState", () => {
|
|
|
404
404
|
}
|
|
405
405
|
});
|
|
406
406
|
|
|
407
|
+
it("Updates edit view value and reset error correctly with custom validation rules when validation was passed", () => {
|
|
408
|
+
const useDispatchWithModulesDataSpy = sinon.spy();
|
|
409
|
+
const useDispatchWithModulesDataStub = sinon
|
|
410
|
+
.stub(useDispatchWithModulesDataMock, "useDispatchWithModulesData")
|
|
411
|
+
.returns(useDispatchWithModulesDataSpy);
|
|
412
|
+
|
|
413
|
+
try {
|
|
414
|
+
// TODOJOC
|
|
415
|
+
const mountedComponent = mountComponent();
|
|
416
|
+
|
|
417
|
+
const fieldComponent = mountedComponent.find(`#id1-prop1-update`);
|
|
418
|
+
|
|
419
|
+
const event = {
|
|
420
|
+
target: {
|
|
421
|
+
value: "anotherValue",
|
|
422
|
+
},
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
fieldComponent.invoke("onClick")(event);
|
|
426
|
+
|
|
427
|
+
const resetEvent = {
|
|
428
|
+
target: {
|
|
429
|
+
value: "custom",
|
|
430
|
+
},
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
fieldComponent.invoke("onClick")(resetEvent);
|
|
434
|
+
|
|
435
|
+
const id = "id1";
|
|
436
|
+
const fieldName = "prop1";
|
|
437
|
+
const initialFieldValue = fieldInitialValues[id][fieldName];
|
|
438
|
+
|
|
439
|
+
expect(useDispatchWithModulesDataSpy, "to have a call satisfying", {
|
|
440
|
+
args: [setEditModelField, [[id, fieldName], "anotherValue", initialFieldValue, entityId, sectionName]],
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
expect(useDispatchWithModulesDataSpy, "to have a call satisfying", {
|
|
444
|
+
args: [setEditModelFieldError, [[id, fieldName], "customRule", entityId, sectionName]],
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
expect(useDispatchWithModulesDataSpy, "to have a call satisfying", {
|
|
448
|
+
args: [removeEditModelFieldError, [[id, fieldName], entityId, sectionName]],
|
|
449
|
+
});
|
|
450
|
+
} finally {
|
|
451
|
+
useDispatchWithModulesDataStub.restore();
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
|
|
407
455
|
it.each([
|
|
408
456
|
["id1", "prop1"],
|
|
409
457
|
["id1", "prop2"],
|