orc-shared 1.1.0-dev.9 → 1.1.2
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/actions/applications.js +1 -1
- package/dist/actions/authentication.js +1 -1
- package/dist/actions/countries.js +1 -1
- package/dist/actions/locale.js +1 -1
- package/dist/actions/makeApiAction.js +73 -3
- package/dist/actions/makeOrcApiAction.js +2 -2
- package/dist/actions/metadata.js +295 -31
- package/dist/actions/navigation.js +3 -3
- package/dist/actions/requestState.js +78 -0
- package/dist/actions/requestsApi.js +58 -7
- package/dist/actions/scopes.js +1 -1
- package/dist/actions/timezones.js +1 -1
- package/dist/actions/toasts.js +1 -1
- package/dist/actions/versionInfo.js +1 -1
- package/dist/actions/view.js +1 -1
- package/dist/buildStore.js +7 -4
- package/dist/components/AppFrame/About.js +3 -3
- package/dist/components/AppFrame/ApplicationSelector/ApplicationDialog.js +115 -62
- package/dist/components/AppFrame/ApplicationSelector/index.js +45 -47
- package/dist/components/AppFrame/MenuItem.js +1 -1
- package/dist/components/AppFrame/Preferences.js +3 -3
- package/dist/components/AppFrame/Sidebar.js +1 -1
- package/dist/components/AppFrame/Topbar.js +1 -1
- package/dist/components/Authenticate.js +1 -1
- package/dist/components/CategoryList.js +1 -1
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/DropMenu/Menu.js +1 -1
- package/dist/components/DropMenu/index.js +1 -1
- package/dist/components/Form/FieldList.js +3 -3
- package/dist/components/Form/Form.js +1 -1
- package/dist/components/Form/Inputs/Button.js +1 -1
- package/dist/components/Form/Inputs/FieldButtons.js +1 -1
- package/dist/components/Form/Inputs/Number.js +1 -1
- package/dist/components/Form/Inputs/ReadOnly.js +1 -1
- package/dist/components/Form/Inputs/SmallButton.js +1 -1
- package/dist/components/Form/Inputs/Text.js +1 -1
- package/dist/components/Form/Inputs/Time.js +1 -1
- package/dist/components/Form/Inputs/Toggles.js +1 -1
- package/dist/components/Form/Inputs/Translation.js +3 -3
- package/dist/components/List/HeadCell.js +1 -1
- package/dist/components/List/List.js +1 -1
- package/dist/components/List/Row.js +1 -1
- package/dist/components/List/enhanceColumnDefs.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/List.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/Notification.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +3 -3
- package/dist/components/MaterialUI/DataDisplay/SelectionList.js +19 -6
- package/dist/components/MaterialUI/DataDisplay/Table.js +28 -10
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +5 -2
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +5 -2
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/index.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +3 -3
- package/dist/components/MaterialUI/Feedback/useNotification.js +1 -1
- package/dist/components/MaterialUI/Inputs/Autocomplete.js +2 -2
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/DatePicker.js +11 -0
- package/dist/components/MaterialUI/Inputs/InputBase.js +3 -2
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/dist/components/MaterialUI/Inputs/RadioProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/Select.js +2 -2
- package/dist/components/MaterialUI/Inputs/SelectProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/Switch.js +3 -3
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/TimePicker.js +19 -8
- package/dist/components/MaterialUI/Inputs/createInput.js +3 -3
- package/dist/components/MaterialUI/Inputs/index.js +1 -1
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +1 -1
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +1 -1
- package/dist/components/MaterialUI/Navigation/TabBar.js +38 -33
- package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +13 -5
- package/dist/components/MaterialUI/ScopeSelector/ScopeTreeView.js +8 -4
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +9 -6
- package/dist/components/MaterialUI/Surfaces/ExpansionPanel.js +11 -2
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +10 -2
- package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +5 -2
- package/dist/components/MaterialUI/Surfaces/paperProps.js +1 -1
- package/dist/components/MaterialUI/muiThemes.js +21 -6
- package/dist/components/MaterialUI/textProps.js +1 -1
- package/dist/components/Modules.js +24 -2
- package/dist/components/MultiSelector.js +1 -1
- package/dist/components/Navigation/Bar.js +3 -3
- package/dist/components/Navigation/Tab.js +1 -1
- package/dist/components/Navigation/useNavigationState.js +30 -4
- package/dist/components/Placeholder.js +1 -1
- package/dist/components/Routing/FullPage.js +2 -0
- package/dist/components/Routing/Segment.js +4 -3
- package/dist/components/Routing/SegmentPage.js +8 -6
- package/dist/components/Routing/withWaypointing.js +10 -4
- package/dist/components/Scope/ScopeNode.js +1 -1
- package/dist/components/Scope/Selector.js +1 -1
- package/dist/components/Scope/index.js +11 -3
- package/dist/components/Scope/useScopeSelect.js +1 -1
- package/dist/components/Selector.js +1 -1
- package/dist/components/Sidepanel.js +1 -2
- package/dist/components/Spritesheet.js +1 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/ToastList.js +1 -1
- package/dist/components/Toolbar.js +1 -1
- package/dist/components/Treeview/Label.js +1 -1
- package/dist/components/Treeview/Leaf.js +1 -1
- package/dist/components/Treeview/Node.js +3 -3
- package/dist/components/Treeview/index.js +2 -2
- package/dist/components/Treeview/settings.js +1 -1
- package/dist/constants.js +26 -1
- package/dist/content/icons/html-templates.svg +3 -0
- package/dist/content/iconsSheet.svg +3 -0
- package/dist/getThemeOverrides.js +2 -2
- package/dist/hocs/withInfiniteScroll.js +1 -1
- package/dist/hocs/withUpdateHandler.js +2 -2
- package/dist/hooks/useDispatchWithModulesData.js +1 -1
- package/dist/hooks/useEditState.js +3 -3
- package/dist/hooks/useEntityLoader.js +182 -0
- package/dist/hooks/useFullEntityEditState.js +3 -3
- package/dist/hooks/useInfiniteScroll.js +104 -0
- package/dist/hooks/useLabelMessage.js +3 -3
- package/dist/hooks/useLoader.js +1 -0
- package/dist/hooks/useMultipleFieldEditState.js +2 -2
- package/dist/hooks/useNavigationHandler.js +1 -1
- package/dist/hooks/useNotificationRequestState.js +159 -0
- package/dist/hooks/useRequestState.js +146 -0
- package/dist/hooks/useSelectorAndUnwrap.js +1 -1
- package/dist/reducers/metadata.js +52 -26
- package/dist/reducers/requestStates.js +181 -0
- package/dist/schemas/countries.js +1 -1
- package/dist/schemas/definitions.js +1 -1
- package/dist/schemas/metadata.js +1 -1
- package/dist/schemas/productDefinitions.js +1 -1
- package/dist/schemas/timezones.js +1 -1
- package/dist/selectors/applications.js +1 -1
- package/dist/selectors/authentication.js +1 -2
- package/dist/selectors/countries.js +1 -1
- package/dist/selectors/locale.js +1 -1
- package/dist/selectors/metadata.js +117 -17
- package/dist/selectors/navigation.js +1 -1
- package/dist/selectors/requestStates.js +82 -0
- package/dist/selectors/requests.js +1 -1
- package/dist/selectors/scope.js +2 -1
- package/dist/selectors/versionInfo.js +1 -1
- package/dist/selectors/view.js +1 -1
- package/dist/sharedMessages.js +44 -0
- package/dist/spawnerMiddleware.js +1 -1
- package/dist/utils/displayModeHelper.js +1 -1
- package/dist/utils/flatten.js +2 -2
- package/dist/utils/localizationHelper.js +1 -1
- package/dist/utils/mapHelper.js +1 -1
- package/dist/utils/modelValidationHelper.js +2 -2
- package/dist/utils/parseHelper.js +1 -1
- package/dist/utils/propertyHelper.js +2 -2
- package/dist/utils/propertyValidator.js +1 -1
- package/dist/utils/setTranslation.js +27 -1
- package/dist/utils/setTranslationWithFallback.js +33 -3
- package/dist/utils/testUtils.js +6 -2
- package/dist/utils/timezoneHelper.js +111 -0
- package/dist/utils/unwrapImmutable.js +1 -1
- package/dist/utils/urlHelper.js +11 -1
- package/package.json +3 -7
- package/src/actions/makeApiAction.js +24 -1
- package/src/actions/makeApiAction.test.js +76 -3
- package/src/actions/metadata.js +130 -0
- package/src/actions/metadata.test.js +337 -5
- package/src/actions/requestState.js +8 -0
- package/src/actions/requestState.test.js +14 -0
- package/src/actions/requestsApi.js +30 -0
- package/src/buildStore.js +2 -0
- package/src/components/AppFrame/AppFrame.test.js +6 -16
- package/src/components/AppFrame/ApplicationSelector/ApplicationDialog.js +105 -82
- package/src/components/AppFrame/ApplicationSelector/ApplicationDialog.test.js +60 -23
- package/src/components/AppFrame/ApplicationSelector/ApplicationSelector.test.js +22 -89
- package/src/components/AppFrame/ApplicationSelector/index.js +34 -15
- package/src/components/AppFrame/Topbar.test.js +2 -4
- package/src/components/MaterialUI/DataDisplay/SelectionList.js +14 -6
- package/src/components/MaterialUI/DataDisplay/SelectionList.test.js +21 -11
- package/src/components/MaterialUI/DataDisplay/Table.js +29 -5
- package/src/components/MaterialUI/DataDisplay/Table.test.js +23 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.test.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TransferList.js +3 -0
- package/src/components/MaterialUI/Inputs/DatePicker.js +11 -0
- package/src/components/MaterialUI/Inputs/InputBase.js +3 -1
- package/src/components/MaterialUI/Inputs/InputBase.test.js +38 -0
- package/src/components/MaterialUI/Inputs/TimePicker.js +9 -3
- package/src/components/MaterialUI/Inputs/TimePicker.test.js +263 -118
- package/src/components/MaterialUI/Navigation/TabBar.js +82 -78
- package/src/components/MaterialUI/Navigation/TabBar.test.js +129 -3
- package/src/components/MaterialUI/ScopeSelector/ScopeSelector.js +9 -3
- package/src/components/MaterialUI/ScopeSelector/ScopeSelector.test.js +29 -0
- package/src/components/MaterialUI/ScopeSelector/ScopeTreeView.js +4 -1
- package/src/components/MaterialUI/ScopeSelector/ScopeTreeView.test.js +52 -0
- package/src/components/MaterialUI/ScopeSelector/TreeItem.js +9 -6
- package/src/components/MaterialUI/ScopeSelector/TreeItem.test.js +63 -2
- package/src/components/MaterialUI/Surfaces/ExpansionPanel.js +14 -1
- package/src/components/MaterialUI/Surfaces/ExpansionPanel.test.js +16 -0
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +11 -2
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.test.js +36 -0
- package/src/components/MaterialUI/Surfaces/expansionPanelProps.js +2 -0
- package/src/components/MaterialUI/Surfaces/expansionPanelProps.test.js +2 -2
- package/src/components/MaterialUI/muiThemes.js +18 -3
- package/src/components/Modules.js +13 -1
- package/src/components/Modules.test.js +133 -1
- package/src/components/Navigation/Navigation.test.js +2 -0
- package/src/components/Navigation/useNavigationState.js +21 -1
- package/src/components/Navigation/useNavigationState.test.js +10 -0
- package/src/components/Routing/FullPage.js +2 -1
- package/src/components/Routing/FullPage.test.js +52 -0
- package/src/components/Routing/Segment.js +5 -2
- package/src/components/Routing/Segment.test.js +22 -1
- package/src/components/Routing/SegmentPage.js +12 -4
- package/src/components/Routing/SubPage.test.js +1 -1
- package/src/components/Routing/withWaypointing.js +19 -17
- package/src/components/Routing/withWaypointing.test.js +50 -0
- package/src/components/Scope/Scope.test.js +117 -0
- package/src/components/Scope/index.js +6 -10
- package/src/components/Sidepanel.js +0 -1
- package/src/components/Sidepanel.test.js +0 -3
- package/src/constants.js +18 -0
- package/src/content/icons/html-templates.svg +3 -0
- package/src/content/iconsSheet.svg +3 -0
- package/src/hooks/useEntityLoader.js +68 -0
- package/src/hooks/useEntityLoader.test.js +266 -0
- package/src/hooks/useInfiniteScroll.js +25 -0
- package/src/hooks/useInfiniteScroll.test.js +87 -0
- package/src/hooks/useLoader.js +1 -0
- package/src/hooks/useNotificationRequestState.js +78 -0
- package/src/hooks/useNotificationRequestState.test.js +264 -0
- package/src/hooks/useRequestState.js +57 -0
- package/src/hooks/useRequestState.test.js +217 -0
- package/src/reducers/metadata.js +76 -16
- package/src/reducers/metadata.test.js +458 -4
- package/src/reducers/requestStates.js +98 -0
- package/src/reducers/requestStates.test.js +399 -0
- package/src/selectors/authentication.js +0 -1
- package/src/selectors/locale.test.js +0 -2
- package/src/selectors/metadata.js +90 -19
- package/src/selectors/metadata.test.js +532 -123
- package/src/selectors/requestStates.js +12 -0
- package/src/selectors/requestStates.test.js +83 -0
- package/src/selectors/scope.js +1 -1
- package/src/sharedMessages.js +44 -0
- package/src/translations/en-US.json +12 -1
- package/src/translations/fr-CA.json +13 -2
- package/src/utils/modelValidationHelper.js +1 -1
- package/src/utils/setTranslation.js +16 -1
- package/src/utils/setTranslation.test.js +24 -0
- package/src/utils/setTranslationWithFallback.js +19 -2
- package/src/utils/setTranslationWithFallback.test.js +104 -6
- package/src/utils/testUtils.js +3 -1
- package/src/utils/timezoneHelper.js +140 -0
- package/src/utils/timezoneHelper.test.js +33 -0
- package/src/utils/urlHelper.js +6 -0
- package/src/translations/it-IT.json +0 -54
|
@@ -20,9 +20,19 @@ import {
|
|
|
20
20
|
variantPropertyKeyValuesSelector,
|
|
21
21
|
profileAttributeGroupsSelector,
|
|
22
22
|
selectCurrentLookupDetails,
|
|
23
|
+
mappedDefinitionsListSelector,
|
|
24
|
+
baseAttributesSelector,
|
|
25
|
+
mappedCustomDefinitionsListSelector,
|
|
26
|
+
mappedBaseDefinitionsListSelector,
|
|
27
|
+
newProfileDefinitionInstanceSelector,
|
|
28
|
+
newProfileDefinitionNameSelector,
|
|
29
|
+
definitionEntityBaseAttributesSelector,
|
|
30
|
+
definitionEntityCustomAttributesSelector,
|
|
31
|
+
lookupByNameSelector,
|
|
32
|
+
mappedLookupsListSelector,
|
|
23
33
|
} from "./metadata";
|
|
24
34
|
|
|
25
|
-
const
|
|
35
|
+
const lookups = {
|
|
26
36
|
CanceledStatusReasons: {
|
|
27
37
|
lookupName: "CanceledStatusReasons",
|
|
28
38
|
values: {
|
|
@@ -65,6 +75,48 @@ const orderLookups = {
|
|
|
65
75
|
},
|
|
66
76
|
};
|
|
67
77
|
|
|
78
|
+
describe("mappedLookupsListSelector", () => {
|
|
79
|
+
let state;
|
|
80
|
+
beforeEach(() => {
|
|
81
|
+
state = Immutable.fromJS({
|
|
82
|
+
locale: { locale: "it-IT" },
|
|
83
|
+
metadata: {
|
|
84
|
+
lookups: {
|
|
85
|
+
order: {
|
|
86
|
+
index: lookups,
|
|
87
|
+
list: ["CanceledStatusReasons", "CartStatus"],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("retrieves mapped lookups", () => {
|
|
95
|
+
return expect(
|
|
96
|
+
mappedLookupsListSelector,
|
|
97
|
+
"when called with",
|
|
98
|
+
["order"],
|
|
99
|
+
"when called with",
|
|
100
|
+
[state],
|
|
101
|
+
"to satisfy",
|
|
102
|
+
Immutable.fromJS({
|
|
103
|
+
CanceledStatusReasons: {
|
|
104
|
+
lookupName: "CanceledStatusReasons",
|
|
105
|
+
isActive: true,
|
|
106
|
+
isSystem: true,
|
|
107
|
+
displayName: "[CanceledStatusReasons]",
|
|
108
|
+
},
|
|
109
|
+
CartStatus: {
|
|
110
|
+
lookupName: "CartStatus",
|
|
111
|
+
isActive: true,
|
|
112
|
+
isSystem: true,
|
|
113
|
+
displayName: "[CartStatus]",
|
|
114
|
+
},
|
|
115
|
+
}),
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
68
120
|
describe("namedLookupSelector", () => {
|
|
69
121
|
let state;
|
|
70
122
|
beforeEach(() => {
|
|
@@ -146,6 +198,92 @@ describe("namedLookupSelector", () => {
|
|
|
146
198
|
));
|
|
147
199
|
});
|
|
148
200
|
|
|
201
|
+
describe("lookupByNameSelector ", () => {
|
|
202
|
+
let state;
|
|
203
|
+
beforeEach(() => {
|
|
204
|
+
state = Immutable.fromJS({
|
|
205
|
+
locale: { locale: "fr-CA" },
|
|
206
|
+
metadata: {
|
|
207
|
+
lookups: {
|
|
208
|
+
order: {
|
|
209
|
+
index: {
|
|
210
|
+
CanceledStatusReasons: {
|
|
211
|
+
lookupName: "CanceledStatusReasons",
|
|
212
|
+
values: {
|
|
213
|
+
CanceledReason1: {
|
|
214
|
+
id: "e16d07f847284775b77cfb985724cf58",
|
|
215
|
+
value: "CanceledReason1",
|
|
216
|
+
lookupId: "CanceledStatusReasons",
|
|
217
|
+
sortOrder: 0,
|
|
218
|
+
isActive: true,
|
|
219
|
+
isSystem: true,
|
|
220
|
+
},
|
|
221
|
+
CanceledReason2: {
|
|
222
|
+
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
223
|
+
value: "CanceledReason2",
|
|
224
|
+
lookupId: "CanceledStatusReasons",
|
|
225
|
+
sortOrder: 0,
|
|
226
|
+
isActive: true,
|
|
227
|
+
isSystem: true,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
isActive: true,
|
|
231
|
+
isSystem: true,
|
|
232
|
+
displayName: {
|
|
233
|
+
"en-CA": "Cancellation Reasons",
|
|
234
|
+
"en-US": "Cancellation Reasons",
|
|
235
|
+
"fr-CA": "Raison annulation",
|
|
236
|
+
"it-IT": "Motivi per l'annullamento",
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
CartStatus: {
|
|
240
|
+
lookupName: "CartStatus",
|
|
241
|
+
values: {},
|
|
242
|
+
isActive: true,
|
|
243
|
+
isSystem: true,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
list: [],
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
it("gets a named lookup for a module", () =>
|
|
254
|
+
expect(
|
|
255
|
+
lookupByNameSelector,
|
|
256
|
+
"when called with",
|
|
257
|
+
["order", "CanceledStatusReasons"],
|
|
258
|
+
"when called with",
|
|
259
|
+
[state],
|
|
260
|
+
"to satisfy",
|
|
261
|
+
Immutable.fromJS({
|
|
262
|
+
lookupName: "CanceledStatusReasons",
|
|
263
|
+
displayName: {
|
|
264
|
+
"en-CA": "Cancellation Reasons",
|
|
265
|
+
"en-US": "Cancellation Reasons",
|
|
266
|
+
"fr-CA": "Raison annulation",
|
|
267
|
+
"it-IT": "Motivi per l'annullamento",
|
|
268
|
+
},
|
|
269
|
+
values: {},
|
|
270
|
+
isActive: true,
|
|
271
|
+
isSystem: true,
|
|
272
|
+
}),
|
|
273
|
+
));
|
|
274
|
+
|
|
275
|
+
it("will get an empty Map if lookup does not exist", () =>
|
|
276
|
+
expect(
|
|
277
|
+
lookupByNameSelector,
|
|
278
|
+
"when called with",
|
|
279
|
+
["order", "NotALookup"],
|
|
280
|
+
"when called with",
|
|
281
|
+
[state],
|
|
282
|
+
"to equal",
|
|
283
|
+
null,
|
|
284
|
+
));
|
|
285
|
+
});
|
|
286
|
+
|
|
149
287
|
describe("namedLookupValuesSelector", () => {
|
|
150
288
|
let state;
|
|
151
289
|
beforeEach(() => {
|
|
@@ -348,7 +486,7 @@ describe("namedLookupLocalizedSelector", () => {
|
|
|
348
486
|
lookups: {
|
|
349
487
|
order: {
|
|
350
488
|
index: {
|
|
351
|
-
...
|
|
489
|
+
...lookups,
|
|
352
490
|
DistanceUOM: {
|
|
353
491
|
lookupName: "DistanceUOM",
|
|
354
492
|
values: {
|
|
@@ -485,7 +623,7 @@ describe("namedLookupLocalizedValuesSelector", () => {
|
|
|
485
623
|
metadata: {
|
|
486
624
|
lookups: {
|
|
487
625
|
order: {
|
|
488
|
-
index:
|
|
626
|
+
index: lookups,
|
|
489
627
|
list: [],
|
|
490
628
|
},
|
|
491
629
|
},
|
|
@@ -545,7 +683,7 @@ describe("lookupsListCurrentInfo", () => {
|
|
|
545
683
|
metadata: {
|
|
546
684
|
lookups: {
|
|
547
685
|
order: {
|
|
548
|
-
index:
|
|
686
|
+
index: lookups,
|
|
549
687
|
list: [],
|
|
550
688
|
},
|
|
551
689
|
},
|
|
@@ -587,7 +725,7 @@ describe("lookupsNextPageToLoad", () => {
|
|
|
587
725
|
metadata: {
|
|
588
726
|
lookups: {
|
|
589
727
|
order: {
|
|
590
|
-
index:
|
|
728
|
+
index: lookups,
|
|
591
729
|
list: [],
|
|
592
730
|
},
|
|
593
731
|
},
|
|
@@ -628,7 +766,7 @@ describe("mappedLookupListSelector", () => {
|
|
|
628
766
|
metadata: {
|
|
629
767
|
lookups: {
|
|
630
768
|
order: {
|
|
631
|
-
index:
|
|
769
|
+
index: lookups,
|
|
632
770
|
list: ["CanceledStatusReasons", "CartStatus"],
|
|
633
771
|
},
|
|
634
772
|
},
|
|
@@ -645,7 +783,7 @@ describe("mappedLookupListSelector", () => {
|
|
|
645
783
|
[state],
|
|
646
784
|
"to satisfy",
|
|
647
785
|
Immutable.fromJS(
|
|
648
|
-
Object.values(
|
|
786
|
+
Object.values(lookups).map(item => {
|
|
649
787
|
item.id = item.lookupName;
|
|
650
788
|
return item;
|
|
651
789
|
}),
|
|
@@ -661,7 +799,7 @@ describe("mappedLookupListSelector", () => {
|
|
|
661
799
|
[state],
|
|
662
800
|
"to satisfy",
|
|
663
801
|
Immutable.fromJS(
|
|
664
|
-
Object.values(
|
|
802
|
+
Object.values(lookups).map(item => {
|
|
665
803
|
item.id = item.lookupName;
|
|
666
804
|
return item;
|
|
667
805
|
}),
|
|
@@ -710,6 +848,143 @@ describe("definitions", () => {
|
|
|
710
848
|
description: "InnaCustom2",
|
|
711
849
|
};
|
|
712
850
|
|
|
851
|
+
let baseBuitInAttribute1 = {
|
|
852
|
+
maximum: 256,
|
|
853
|
+
dataType: "Text",
|
|
854
|
+
isRequired: false,
|
|
855
|
+
name: "Username",
|
|
856
|
+
displayOrder: 1,
|
|
857
|
+
isSearchable: true,
|
|
858
|
+
displayName: {
|
|
859
|
+
"en-CA": "User name",
|
|
860
|
+
"en-US": "User name",
|
|
861
|
+
"fr-CA": "User name",
|
|
862
|
+
},
|
|
863
|
+
minimum: 1,
|
|
864
|
+
multilingual: false,
|
|
865
|
+
isBuiltIn: true,
|
|
866
|
+
groupId: "Default",
|
|
867
|
+
allowMultipleValues: false,
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
let baseBuitInAttribute2 = {
|
|
871
|
+
maximum: 256,
|
|
872
|
+
dataType: "Text",
|
|
873
|
+
isRequired: false,
|
|
874
|
+
name: "Email",
|
|
875
|
+
displayOrder: 2,
|
|
876
|
+
isSearchable: true,
|
|
877
|
+
displayName: {
|
|
878
|
+
"en-CA": "Email",
|
|
879
|
+
"en-US": "Email",
|
|
880
|
+
"fr-CA": "Email",
|
|
881
|
+
},
|
|
882
|
+
minimum: 0,
|
|
883
|
+
multilingual: false,
|
|
884
|
+
isBuiltIn: true,
|
|
885
|
+
groupId: "Default",
|
|
886
|
+
allowMultipleValues: false,
|
|
887
|
+
};
|
|
888
|
+
|
|
889
|
+
let baseBuitInAttribute3 = {
|
|
890
|
+
maximum: 64,
|
|
891
|
+
dataType: "Text",
|
|
892
|
+
isRequired: false,
|
|
893
|
+
name: "LastName",
|
|
894
|
+
displayOrder: 3,
|
|
895
|
+
isSearchable: true,
|
|
896
|
+
displayName: {
|
|
897
|
+
"en-CA": "Last name",
|
|
898
|
+
"en-US": "Last name",
|
|
899
|
+
"fr-CA": "Last name",
|
|
900
|
+
"it-IT": "Cognome",
|
|
901
|
+
},
|
|
902
|
+
minimum: 0,
|
|
903
|
+
multilingual: false,
|
|
904
|
+
isBuiltIn: true,
|
|
905
|
+
groupId: "Default",
|
|
906
|
+
allowMultipleValues: false,
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
let baseBuitInAttribute4 = {
|
|
910
|
+
maximum: 64,
|
|
911
|
+
dataType: "Text",
|
|
912
|
+
isRequired: false,
|
|
913
|
+
name: "FirstName",
|
|
914
|
+
displayOrder: 4,
|
|
915
|
+
isSearchable: true,
|
|
916
|
+
displayName: {
|
|
917
|
+
"ar-JO": "",
|
|
918
|
+
"en-CA": "First Name",
|
|
919
|
+
"en-US": "First Name",
|
|
920
|
+
"es-ES": "",
|
|
921
|
+
"fr-CA": "First Name",
|
|
922
|
+
"it-IT": "Nome",
|
|
923
|
+
},
|
|
924
|
+
minimum: 0,
|
|
925
|
+
multilingual: false,
|
|
926
|
+
isBuiltIn: true,
|
|
927
|
+
groupId: "Default",
|
|
928
|
+
allowMultipleValues: false,
|
|
929
|
+
};
|
|
930
|
+
|
|
931
|
+
let baseCustomAttribute1 = {
|
|
932
|
+
maximum: 64,
|
|
933
|
+
dataType: "Text",
|
|
934
|
+
isRequired: false,
|
|
935
|
+
name: "BaseAttribute1",
|
|
936
|
+
displayOrder: 1,
|
|
937
|
+
isSearchable: true,
|
|
938
|
+
displayName: {
|
|
939
|
+
"en-CA": "Base Attribute1",
|
|
940
|
+
"en-US": "Base Attribute1",
|
|
941
|
+
"fr-CA": "Base Attribute1",
|
|
942
|
+
},
|
|
943
|
+
minimum: 0,
|
|
944
|
+
multilingual: false,
|
|
945
|
+
isBuiltIn: false,
|
|
946
|
+
groupId: "Default",
|
|
947
|
+
allowMultipleValues: false,
|
|
948
|
+
};
|
|
949
|
+
|
|
950
|
+
let baseCustomAttribute2 = {
|
|
951
|
+
maximum: 64,
|
|
952
|
+
dataType: "Text",
|
|
953
|
+
isRequired: false,
|
|
954
|
+
name: "BaseAttribute2",
|
|
955
|
+
displayOrder: 2,
|
|
956
|
+
isSearchable: true,
|
|
957
|
+
displayName: {
|
|
958
|
+
"en-CA": "Base Attribute 2",
|
|
959
|
+
"en-US": "Base Attribute 2",
|
|
960
|
+
"fr-CA": "Base Attribute 2",
|
|
961
|
+
},
|
|
962
|
+
minimum: 0,
|
|
963
|
+
multilingual: false,
|
|
964
|
+
isBuiltIn: false,
|
|
965
|
+
groupId: "Default",
|
|
966
|
+
allowMultipleValues: false,
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
let baseCustomAttribute3 = {
|
|
970
|
+
maximum: 64,
|
|
971
|
+
dataType: "Text",
|
|
972
|
+
isRequired: false,
|
|
973
|
+
name: "BaseAttribute3",
|
|
974
|
+
displayOrder: 3,
|
|
975
|
+
isSearchable: true,
|
|
976
|
+
displayName: {
|
|
977
|
+
"en-CA": "Base Attribute 3",
|
|
978
|
+
"en-US": "Base Attribute 3",
|
|
979
|
+
"fr-CA": "Base Attribute 3",
|
|
980
|
+
},
|
|
981
|
+
minimum: 0,
|
|
982
|
+
multilingual: false,
|
|
983
|
+
isBuiltIn: false,
|
|
984
|
+
groupId: "Default",
|
|
985
|
+
allowMultipleValues: false,
|
|
986
|
+
};
|
|
987
|
+
|
|
713
988
|
beforeEach(() => {
|
|
714
989
|
state = Immutable.fromJS({
|
|
715
990
|
locale: {
|
|
@@ -840,90 +1115,15 @@ describe("definitions", () => {
|
|
|
840
1115
|
entityTypeName: "CUSTOMER",
|
|
841
1116
|
isBuiltIn: true,
|
|
842
1117
|
attributes: [
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
dataType: "Text",
|
|
846
|
-
isRequired: false,
|
|
847
|
-
name: "Username",
|
|
848
|
-
displayOrder: 0,
|
|
849
|
-
isSearchable: true,
|
|
850
|
-
displayName: {
|
|
851
|
-
"ar-JO": "",
|
|
852
|
-
"en-CA": "User name",
|
|
853
|
-
"en-US": "User name",
|
|
854
|
-
"es-ES": "",
|
|
855
|
-
"fr-CA": "User name",
|
|
856
|
-
"it-IT": "Nome utente",
|
|
857
|
-
},
|
|
858
|
-
minimum: 1,
|
|
859
|
-
multilingual: false,
|
|
860
|
-
isBuiltIn: true,
|
|
861
|
-
groupId: "Default",
|
|
862
|
-
allowMultipleValues: false,
|
|
863
|
-
},
|
|
864
|
-
{
|
|
865
|
-
maximum: 256,
|
|
866
|
-
dataType: "Text",
|
|
867
|
-
isRequired: false,
|
|
868
|
-
name: "Email",
|
|
869
|
-
displayOrder: 0,
|
|
870
|
-
isSearchable: true,
|
|
871
|
-
displayName: {
|
|
872
|
-
"ar-JO": "",
|
|
873
|
-
"en-CA": "Email",
|
|
874
|
-
"en-US": "Email",
|
|
875
|
-
"es-ES": "",
|
|
876
|
-
"fr-CA": "Email",
|
|
877
|
-
"it-IT": "Email",
|
|
878
|
-
},
|
|
879
|
-
minimum: 0,
|
|
880
|
-
multilingual: false,
|
|
881
|
-
isBuiltIn: true,
|
|
882
|
-
groupId: "Default",
|
|
883
|
-
allowMultipleValues: false,
|
|
884
|
-
},
|
|
1118
|
+
baseBuitInAttribute1,
|
|
1119
|
+
baseBuitInAttribute2,
|
|
885
1120
|
customProfileAttribute1,
|
|
886
1121
|
customProfileAttribute2,
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
displayOrder: 0,
|
|
893
|
-
isSearchable: true,
|
|
894
|
-
displayName: {
|
|
895
|
-
"en-CA": "Last name",
|
|
896
|
-
"en-US": "Last name",
|
|
897
|
-
"fr-CA": "Last name",
|
|
898
|
-
"it-IT": "Cognome",
|
|
899
|
-
},
|
|
900
|
-
minimum: 0,
|
|
901
|
-
multilingual: false,
|
|
902
|
-
isBuiltIn: true,
|
|
903
|
-
groupId: "Default",
|
|
904
|
-
allowMultipleValues: false,
|
|
905
|
-
},
|
|
906
|
-
{
|
|
907
|
-
maximum: 64,
|
|
908
|
-
dataType: "Text",
|
|
909
|
-
isRequired: false,
|
|
910
|
-
name: "FirstName",
|
|
911
|
-
displayOrder: 0,
|
|
912
|
-
isSearchable: true,
|
|
913
|
-
displayName: {
|
|
914
|
-
"ar-JO": "",
|
|
915
|
-
"en-CA": "First Name",
|
|
916
|
-
"en-US": "First Name",
|
|
917
|
-
"es-ES": "",
|
|
918
|
-
"fr-CA": "First Name",
|
|
919
|
-
"it-IT": "Nome",
|
|
920
|
-
},
|
|
921
|
-
minimum: 0,
|
|
922
|
-
multilingual: false,
|
|
923
|
-
isBuiltIn: true,
|
|
924
|
-
groupId: "Default",
|
|
925
|
-
allowMultipleValues: false,
|
|
926
|
-
},
|
|
1122
|
+
baseBuitInAttribute4,
|
|
1123
|
+
baseBuitInAttribute3,
|
|
1124
|
+
baseCustomAttribute1,
|
|
1125
|
+
baseCustomAttribute3,
|
|
1126
|
+
baseCustomAttribute2,
|
|
927
1127
|
],
|
|
928
1128
|
isSharedEntity: true,
|
|
929
1129
|
},
|
|
@@ -1085,6 +1285,131 @@ describe("definitions", () => {
|
|
|
1085
1285
|
expect(profileAttributeGroupsSelector, "when called with", [newState], "to satisfy", null);
|
|
1086
1286
|
});
|
|
1087
1287
|
|
|
1288
|
+
it("will return correct customer profile definition", () => {
|
|
1289
|
+
const expected = Immutable.fromJS({
|
|
1290
|
+
CustomProfile1: {
|
|
1291
|
+
entityTypeName: "CustomProfile1",
|
|
1292
|
+
isBuiltIn: false,
|
|
1293
|
+
isSharedEntity: true,
|
|
1294
|
+
displayName: "CustomProfile1",
|
|
1295
|
+
type: "Shared",
|
|
1296
|
+
},
|
|
1297
|
+
CustomProfile2: {
|
|
1298
|
+
entityTypeName: "CustomProfile2",
|
|
1299
|
+
isBuiltIn: false,
|
|
1300
|
+
displayName: "CustomProfile1",
|
|
1301
|
+
type: "Embedded",
|
|
1302
|
+
},
|
|
1303
|
+
RecursedCustomProfile: {
|
|
1304
|
+
entityTypeName: "RecursedCustomProfile",
|
|
1305
|
+
isBuiltIn: false,
|
|
1306
|
+
displayName: "RecursedCustomProfile",
|
|
1307
|
+
type: "Embedded",
|
|
1308
|
+
},
|
|
1309
|
+
CUSTOMER: {
|
|
1310
|
+
entityTypeName: "CUSTOMER",
|
|
1311
|
+
isBuiltIn: true,
|
|
1312
|
+
isSharedEntity: true,
|
|
1313
|
+
displayName: "Customer",
|
|
1314
|
+
type: "Shared",
|
|
1315
|
+
},
|
|
1316
|
+
PROFILEWITHRECUSREDATTRIBUTE: {
|
|
1317
|
+
entityTypeName: "PROFILEWITHRECUSREDATTRIBUTE",
|
|
1318
|
+
isBuiltIn: false,
|
|
1319
|
+
displayName: "PROFILEWITHRECUSREDATTRIBUTE",
|
|
1320
|
+
type: "Embedded",
|
|
1321
|
+
},
|
|
1322
|
+
});
|
|
1323
|
+
expect(
|
|
1324
|
+
mappedDefinitionsListSelector,
|
|
1325
|
+
"when called with",
|
|
1326
|
+
["customer"],
|
|
1327
|
+
"when called with",
|
|
1328
|
+
[state],
|
|
1329
|
+
"to satisfy",
|
|
1330
|
+
expected,
|
|
1331
|
+
);
|
|
1332
|
+
});
|
|
1333
|
+
|
|
1334
|
+
it("will return correct customer base profile definition", () => {
|
|
1335
|
+
const expected = Immutable.fromJS({
|
|
1336
|
+
CUSTOMER: {
|
|
1337
|
+
entityTypeName: "CUSTOMER",
|
|
1338
|
+
isBuiltIn: true,
|
|
1339
|
+
isSharedEntity: true,
|
|
1340
|
+
displayName: "Customer",
|
|
1341
|
+
type: "Shared",
|
|
1342
|
+
},
|
|
1343
|
+
});
|
|
1344
|
+
expect(
|
|
1345
|
+
mappedBaseDefinitionsListSelector,
|
|
1346
|
+
"when called with",
|
|
1347
|
+
["customer"],
|
|
1348
|
+
"when called with",
|
|
1349
|
+
[state],
|
|
1350
|
+
"to satisfy",
|
|
1351
|
+
expected,
|
|
1352
|
+
);
|
|
1353
|
+
});
|
|
1354
|
+
|
|
1355
|
+
it("will return correct customer custom profile definition", () => {
|
|
1356
|
+
const expected = Immutable.fromJS({
|
|
1357
|
+
CustomProfile1: {
|
|
1358
|
+
displayName: "CustomProfile1",
|
|
1359
|
+
entityTypeName: "CustomProfile1",
|
|
1360
|
+
isBuiltIn: false,
|
|
1361
|
+
isSharedEntity: true,
|
|
1362
|
+
type: "Shared",
|
|
1363
|
+
},
|
|
1364
|
+
CustomProfile2: {
|
|
1365
|
+
displayName: "CustomProfile1",
|
|
1366
|
+
entityTypeName: "CustomProfile2",
|
|
1367
|
+
isBuiltIn: false,
|
|
1368
|
+
type: "Embedded",
|
|
1369
|
+
},
|
|
1370
|
+
RecursedCustomProfile: {
|
|
1371
|
+
displayName: "RecursedCustomProfile",
|
|
1372
|
+
entityTypeName: "RecursedCustomProfile",
|
|
1373
|
+
isBuiltIn: false,
|
|
1374
|
+
type: "Embedded",
|
|
1375
|
+
},
|
|
1376
|
+
PROFILEWITHRECUSREDATTRIBUTE: {
|
|
1377
|
+
displayName: "PROFILEWITHRECUSREDATTRIBUTE",
|
|
1378
|
+
entityTypeName: "PROFILEWITHRECUSREDATTRIBUTE",
|
|
1379
|
+
isBuiltIn: false,
|
|
1380
|
+
type: "Embedded",
|
|
1381
|
+
},
|
|
1382
|
+
});
|
|
1383
|
+
expect(
|
|
1384
|
+
mappedCustomDefinitionsListSelector,
|
|
1385
|
+
"when called with",
|
|
1386
|
+
["customer"],
|
|
1387
|
+
"when called with",
|
|
1388
|
+
[state],
|
|
1389
|
+
"to satisfy",
|
|
1390
|
+
expected,
|
|
1391
|
+
);
|
|
1392
|
+
});
|
|
1393
|
+
|
|
1394
|
+
it("retrieves the state of the profile instance", () => {
|
|
1395
|
+
return expect(newProfileDefinitionInstanceSelector, "when called with", [state], "to satisfy", null);
|
|
1396
|
+
});
|
|
1397
|
+
|
|
1398
|
+
it("retrieves the state of the profile definition name response", () => {
|
|
1399
|
+
return expect(newProfileDefinitionNameSelector, "when called with", [state], "to satisfy", undefined);
|
|
1400
|
+
});
|
|
1401
|
+
|
|
1402
|
+
it("will get an empty Map if definitions do not exist", () =>
|
|
1403
|
+
expect(
|
|
1404
|
+
mappedCustomDefinitionsListSelector,
|
|
1405
|
+
"when called with",
|
|
1406
|
+
["notexistingmodulename"],
|
|
1407
|
+
"when called with",
|
|
1408
|
+
[state],
|
|
1409
|
+
"to equal",
|
|
1410
|
+
Immutable.Map(),
|
|
1411
|
+
));
|
|
1412
|
+
|
|
1088
1413
|
it("will get an empty List if definitios do not exist", () =>
|
|
1089
1414
|
expect(
|
|
1090
1415
|
groupedCustomAttributesDefinitionSelector,
|
|
@@ -1096,7 +1421,7 @@ describe("definitions", () => {
|
|
|
1096
1421
|
{},
|
|
1097
1422
|
));
|
|
1098
1423
|
|
|
1099
|
-
it("will return correct custom profile attributes definition", () => {
|
|
1424
|
+
it("will return correct custom profile attributes definition in correct order", () => {
|
|
1100
1425
|
const expectedGroup1 = customProfileAttribute1.groupId;
|
|
1101
1426
|
const expectedGroup2 = customProfileAttribute2.groupId;
|
|
1102
1427
|
const expectedItem1 = {
|
|
@@ -1108,11 +1433,26 @@ describe("definitions", () => {
|
|
|
1108
1433
|
...{ displayName: customProfileAttribute2.displayName["en-US"] },
|
|
1109
1434
|
};
|
|
1110
1435
|
|
|
1436
|
+
const expectedBaseCustomWithOrder1 = {
|
|
1437
|
+
...baseCustomAttribute1,
|
|
1438
|
+
...{ displayName: baseCustomAttribute1.displayName["en-US"] },
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1441
|
+
const expectedBaseCustomWithOrder2 = {
|
|
1442
|
+
...baseCustomAttribute2,
|
|
1443
|
+
...{ displayName: baseCustomAttribute2.displayName["en-US"] },
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
const expectedBaseCustomWithOrder3 = {
|
|
1447
|
+
...baseCustomAttribute3,
|
|
1448
|
+
...{ displayName: baseCustomAttribute3.displayName["en-US"] },
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1111
1451
|
const expected = Immutable.fromJS({
|
|
1112
1452
|
[expectedGroup1]: {
|
|
1113
1453
|
id: expectedGroup1,
|
|
1114
1454
|
name: "Default en-US",
|
|
1115
|
-
baseAttributes: [],
|
|
1455
|
+
baseAttributes: [expectedBaseCustomWithOrder1, expectedBaseCustomWithOrder2, expectedBaseCustomWithOrder3],
|
|
1116
1456
|
profileAttributes: [expectedItem1],
|
|
1117
1457
|
},
|
|
1118
1458
|
[expectedGroup2]: {
|
|
@@ -1134,42 +1474,111 @@ describe("definitions", () => {
|
|
|
1134
1474
|
);
|
|
1135
1475
|
});
|
|
1136
1476
|
|
|
1477
|
+
it("will return correct full base (built in) customer definition attributes", () => {
|
|
1478
|
+
const expected = Immutable.fromJS([
|
|
1479
|
+
baseBuitInAttribute1,
|
|
1480
|
+
baseBuitInAttribute2,
|
|
1481
|
+
baseBuitInAttribute3,
|
|
1482
|
+
baseBuitInAttribute4,
|
|
1483
|
+
]);
|
|
1484
|
+
expect(
|
|
1485
|
+
definitionEntityBaseAttributesSelector,
|
|
1486
|
+
"when called with",
|
|
1487
|
+
["customer", "CUSTOMER"],
|
|
1488
|
+
"when called with",
|
|
1489
|
+
[state],
|
|
1490
|
+
"to satisfy",
|
|
1491
|
+
expected,
|
|
1492
|
+
);
|
|
1493
|
+
});
|
|
1494
|
+
|
|
1495
|
+
it("will return correct full custom customer definition attributes", () => {
|
|
1496
|
+
const expected = Immutable.fromJS([
|
|
1497
|
+
customProfileAttribute1,
|
|
1498
|
+
customProfileAttribute2,
|
|
1499
|
+
baseCustomAttribute1,
|
|
1500
|
+
baseCustomAttribute2,
|
|
1501
|
+
baseCustomAttribute3,
|
|
1502
|
+
]);
|
|
1503
|
+
expect(
|
|
1504
|
+
definitionEntityCustomAttributesSelector,
|
|
1505
|
+
"when called with",
|
|
1506
|
+
["customer", "CUSTOMER"],
|
|
1507
|
+
"when called with",
|
|
1508
|
+
[state],
|
|
1509
|
+
"to satisfy",
|
|
1510
|
+
expected,
|
|
1511
|
+
);
|
|
1512
|
+
});
|
|
1513
|
+
|
|
1514
|
+
it("will return correct customer base (build in) attributes in correct order", () => {
|
|
1515
|
+
const locale = "en-US";
|
|
1516
|
+
const expectedBaseBuitInAttribute1 = {
|
|
1517
|
+
...baseBuitInAttribute1,
|
|
1518
|
+
...{ displayName: baseBuitInAttribute1.displayName[locale] },
|
|
1519
|
+
};
|
|
1520
|
+
const expectedBaseBuitInAttribute2 = {
|
|
1521
|
+
...baseBuitInAttribute2,
|
|
1522
|
+
...{ displayName: baseBuitInAttribute2.displayName[locale] },
|
|
1523
|
+
};
|
|
1524
|
+
const expectedBaseBuitInAttribute3 = {
|
|
1525
|
+
...baseBuitInAttribute3,
|
|
1526
|
+
...{ displayName: baseBuitInAttribute3.displayName[locale] },
|
|
1527
|
+
};
|
|
1528
|
+
const expectedBaseBuitInAttribute4 = {
|
|
1529
|
+
...baseBuitInAttribute4,
|
|
1530
|
+
...{ displayName: baseBuitInAttribute4.displayName[locale] },
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1533
|
+
const expected = Immutable.fromJS([
|
|
1534
|
+
expectedBaseBuitInAttribute1,
|
|
1535
|
+
expectedBaseBuitInAttribute2,
|
|
1536
|
+
expectedBaseBuitInAttribute3,
|
|
1537
|
+
expectedBaseBuitInAttribute4,
|
|
1538
|
+
]);
|
|
1539
|
+
expect(
|
|
1540
|
+
baseAttributesSelector,
|
|
1541
|
+
"when called with",
|
|
1542
|
+
["customer", "CUSTOMER"],
|
|
1543
|
+
"when called with",
|
|
1544
|
+
[state],
|
|
1545
|
+
"to satisfy",
|
|
1546
|
+
expected,
|
|
1547
|
+
);
|
|
1548
|
+
});
|
|
1549
|
+
|
|
1137
1550
|
it("will return correct customer attributes definition", () => {
|
|
1551
|
+
const locale = "en-US";
|
|
1552
|
+
const expectedProfileAttribute1 = {
|
|
1553
|
+
...customProfileAttribute1,
|
|
1554
|
+
...{ displayName: customProfileAttribute1.displayName[locale] },
|
|
1555
|
+
};
|
|
1556
|
+
const expectedProfileAttribute2 = {
|
|
1557
|
+
...customProfileAttribute2,
|
|
1558
|
+
...{ displayName: customProfileAttribute2.displayName[locale] },
|
|
1559
|
+
};
|
|
1560
|
+
|
|
1561
|
+
const expectedBase1 = {
|
|
1562
|
+
...baseCustomAttribute1,
|
|
1563
|
+
...{ displayName: baseCustomAttribute1.displayName[locale] },
|
|
1564
|
+
};
|
|
1565
|
+
|
|
1566
|
+
const expectedBase2 = {
|
|
1567
|
+
...baseCustomAttribute2,
|
|
1568
|
+
...{ displayName: baseCustomAttribute2.displayName[locale] },
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1571
|
+
const expectedBase3 = {
|
|
1572
|
+
...baseCustomAttribute3,
|
|
1573
|
+
...{ displayName: baseCustomAttribute3.displayName[locale] },
|
|
1574
|
+
};
|
|
1575
|
+
|
|
1138
1576
|
const expected = Immutable.fromJS({
|
|
1139
1577
|
displayName: "Customer",
|
|
1140
1578
|
entityTypeName: "CUSTOMER",
|
|
1141
1579
|
isBuiltIn: true,
|
|
1142
|
-
baseAttributes: [],
|
|
1143
|
-
profileAttributes: [
|
|
1144
|
-
{
|
|
1145
|
-
dataType: "EntityReference",
|
|
1146
|
-
isRequired: false,
|
|
1147
|
-
name: "InnaCustom1",
|
|
1148
|
-
displayOrder: 0,
|
|
1149
|
-
isSearchable: false,
|
|
1150
|
-
displayName: "attribute en-US",
|
|
1151
|
-
referenceTypeName: "CustomProfile1",
|
|
1152
|
-
multilingual: false,
|
|
1153
|
-
isBuiltIn: false,
|
|
1154
|
-
groupId: "Default",
|
|
1155
|
-
allowMultipleValues: true,
|
|
1156
|
-
description: "InnaCustomer",
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
dataType: "EntityReference",
|
|
1160
|
-
isRequired: false,
|
|
1161
|
-
name: "InnaCustom2",
|
|
1162
|
-
displayOrder: 0,
|
|
1163
|
-
isSearchable: false,
|
|
1164
|
-
displayName: "attribute en-UA",
|
|
1165
|
-
referenceTypeName: "CustomProfile2",
|
|
1166
|
-
multilingual: false,
|
|
1167
|
-
isBuiltIn: false,
|
|
1168
|
-
groupId: "CustomGroup",
|
|
1169
|
-
allowMultipleValues: true,
|
|
1170
|
-
description: "InnaCustom2",
|
|
1171
|
-
},
|
|
1172
|
-
],
|
|
1580
|
+
baseAttributes: [expectedBase1, expectedBase2, expectedBase3],
|
|
1581
|
+
profileAttributes: [expectedProfileAttribute1, expectedProfileAttribute2],
|
|
1173
1582
|
isSharedEntity: true,
|
|
1174
1583
|
});
|
|
1175
1584
|
expect(
|