orc-shared 5.8.0-dev.5 → 5.8.0-dev.6
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/reducers/metadata.js +12 -4
- package/package.json +1 -1
- package/src/reducers/metadata.js +12 -17
- package/src/reducers/metadata.test.js +318 -156
|
@@ -160,18 +160,26 @@ var metadataReducer = function metadataReducer(state, action) {
|
|
|
160
160
|
}
|
|
161
161
|
case _metadata2.SAVE_ORDER_LOOKUP_SUCCESS:
|
|
162
162
|
case _metadata2.GET_ORDER_LOOKUP_SUCCESS:
|
|
163
|
-
return
|
|
163
|
+
return lookupReducerHelper.getLookupsQuerySuccess(ORDER_MODULE_NAME, state, {
|
|
164
|
+
payload: [action.payload]
|
|
165
|
+
});
|
|
164
166
|
case _metadata2.ADD_ORDER_LOOKUP_SUCCESS:
|
|
165
167
|
{
|
|
166
|
-
state =
|
|
168
|
+
state = lookupReducerHelper.getLookupsQuerySuccess(ORDER_MODULE_NAME, state, {
|
|
169
|
+
payload: [action.payload]
|
|
170
|
+
});
|
|
167
171
|
return lookupReducerHelper.getPagedLookups(ORDER_MODULE_NAME, state);
|
|
168
172
|
}
|
|
169
173
|
case _metadata2.SAVE_CUSTOMER_LOOKUP_SUCCESS:
|
|
170
174
|
case _metadata2.GET_CUSTOMER_LOOKUP_SUCCESS:
|
|
171
|
-
return
|
|
175
|
+
return lookupReducerHelper.getLookupsQuerySuccess(CUSTOMER_MODULE_NAME, state, {
|
|
176
|
+
payload: [action.payload]
|
|
177
|
+
});
|
|
172
178
|
case _metadata2.ADD_CUSTOMER_LOOKUP_SUCCESS:
|
|
173
179
|
{
|
|
174
|
-
state =
|
|
180
|
+
state = lookupReducerHelper.getLookupsQuerySuccess(CUSTOMER_MODULE_NAME, state, {
|
|
181
|
+
payload: [action.payload]
|
|
182
|
+
});
|
|
175
183
|
return lookupReducerHelper.getPagedLookups(CUSTOMER_MODULE_NAME, state);
|
|
176
184
|
}
|
|
177
185
|
case _metadata2.CREATE_PROFILE_DEFINITION_SUCCESS:
|
package/package.json
CHANGED
package/src/reducers/metadata.js
CHANGED
|
@@ -156,33 +156,28 @@ const metadataReducer = (state = initialState, action) => {
|
|
|
156
156
|
}
|
|
157
157
|
case SAVE_ORDER_LOOKUP_SUCCESS:
|
|
158
158
|
case GET_ORDER_LOOKUP_SUCCESS:
|
|
159
|
-
return
|
|
160
|
-
[
|
|
161
|
-
|
|
162
|
-
);
|
|
159
|
+
return lookupReducerHelper.getLookupsQuerySuccess(ORDER_MODULE_NAME, state, {
|
|
160
|
+
payload: [action.payload],
|
|
161
|
+
});
|
|
163
162
|
|
|
164
163
|
case ADD_ORDER_LOOKUP_SUCCESS: {
|
|
165
|
-
state =
|
|
166
|
-
[
|
|
167
|
-
|
|
168
|
-
);
|
|
164
|
+
state = lookupReducerHelper.getLookupsQuerySuccess(ORDER_MODULE_NAME, state, {
|
|
165
|
+
payload: [action.payload],
|
|
166
|
+
});
|
|
169
167
|
|
|
170
168
|
return lookupReducerHelper.getPagedLookups(ORDER_MODULE_NAME, state);
|
|
171
169
|
}
|
|
172
170
|
|
|
173
171
|
case SAVE_CUSTOMER_LOOKUP_SUCCESS:
|
|
174
172
|
case GET_CUSTOMER_LOOKUP_SUCCESS:
|
|
175
|
-
return
|
|
176
|
-
[
|
|
177
|
-
|
|
178
|
-
);
|
|
173
|
+
return lookupReducerHelper.getLookupsQuerySuccess(CUSTOMER_MODULE_NAME, state, {
|
|
174
|
+
payload: [action.payload],
|
|
175
|
+
});
|
|
179
176
|
|
|
180
177
|
case ADD_CUSTOMER_LOOKUP_SUCCESS: {
|
|
181
|
-
state =
|
|
182
|
-
[
|
|
183
|
-
|
|
184
|
-
);
|
|
185
|
-
|
|
178
|
+
state = lookupReducerHelper.getLookupsQuerySuccess(CUSTOMER_MODULE_NAME, state, {
|
|
179
|
+
payload: [action.payload],
|
|
180
|
+
});
|
|
186
181
|
return lookupReducerHelper.getPagedLookups(CUSTOMER_MODULE_NAME, state);
|
|
187
182
|
}
|
|
188
183
|
|
|
@@ -178,11 +178,27 @@ describe("metadata", () => {
|
|
|
178
178
|
});
|
|
179
179
|
|
|
180
180
|
it("get order lookup success", () => {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const oldState = Immutable.fromJS({
|
|
182
|
+
lookups: {
|
|
183
|
+
order: {
|
|
184
|
+
index: {
|
|
185
|
+
CartStatus: {
|
|
186
|
+
lookupName: "CartStatus",
|
|
187
|
+
values: {},
|
|
188
|
+
isActive: true,
|
|
189
|
+
isSystem: true,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
list: [],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
const action = {
|
|
197
|
+
type: GET_ORDER_LOOKUP_SUCCESS,
|
|
198
|
+
payload: {
|
|
183
199
|
lookupName: "CanceledStatusReasons",
|
|
184
|
-
values:
|
|
185
|
-
|
|
200
|
+
values: [
|
|
201
|
+
{
|
|
186
202
|
id: "e16d07f847284775b77cfb985724cf58",
|
|
187
203
|
value: "CanceledReason1",
|
|
188
204
|
lookupId: "CanceledStatusReasons",
|
|
@@ -190,7 +206,7 @@ describe("metadata", () => {
|
|
|
190
206
|
isActive: true,
|
|
191
207
|
isSystem: true,
|
|
192
208
|
},
|
|
193
|
-
|
|
209
|
+
{
|
|
194
210
|
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
195
211
|
value: "CanceledReason2",
|
|
196
212
|
lookupId: "CanceledStatusReasons",
|
|
@@ -198,37 +214,48 @@ describe("metadata", () => {
|
|
|
198
214
|
isActive: true,
|
|
199
215
|
isSystem: true,
|
|
200
216
|
},
|
|
201
|
-
|
|
202
|
-
isActive: true,
|
|
203
|
-
isSystem: true,
|
|
204
|
-
},
|
|
205
|
-
CartStatus: {
|
|
206
|
-
lookupName: "CartStatus",
|
|
207
|
-
values: {},
|
|
217
|
+
],
|
|
208
218
|
isActive: true,
|
|
209
219
|
isSystem: true,
|
|
210
220
|
},
|
|
211
221
|
};
|
|
212
|
-
|
|
213
|
-
const oldState = Immutable.fromJS({
|
|
214
|
-
lookups: {
|
|
215
|
-
order: {
|
|
216
|
-
index: { CartStatus: lookups.CartStatus },
|
|
217
|
-
list: [],
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
});
|
|
221
|
-
const action = {
|
|
222
|
-
type: GET_ORDER_LOOKUP_SUCCESS,
|
|
223
|
-
payload: lookups.CanceledStatusReasons,
|
|
224
|
-
};
|
|
225
222
|
const newState = reducer(oldState, action);
|
|
226
223
|
return expect(newState, "not to be", oldState).and(
|
|
227
224
|
"to equal",
|
|
228
225
|
Immutable.fromJS({
|
|
229
226
|
lookups: {
|
|
230
227
|
order: {
|
|
231
|
-
index:
|
|
228
|
+
index: {
|
|
229
|
+
CanceledStatusReasons: {
|
|
230
|
+
lookupName: "CanceledStatusReasons",
|
|
231
|
+
values: {
|
|
232
|
+
CanceledReason1: {
|
|
233
|
+
id: "e16d07f847284775b77cfb985724cf58",
|
|
234
|
+
value: "CanceledReason1",
|
|
235
|
+
lookupId: "CanceledStatusReasons",
|
|
236
|
+
sortOrder: 0,
|
|
237
|
+
isActive: true,
|
|
238
|
+
isSystem: true,
|
|
239
|
+
},
|
|
240
|
+
CanceledReason2: {
|
|
241
|
+
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
242
|
+
value: "CanceledReason2",
|
|
243
|
+
lookupId: "CanceledStatusReasons",
|
|
244
|
+
sortOrder: 0,
|
|
245
|
+
isActive: true,
|
|
246
|
+
isSystem: true,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
isActive: true,
|
|
250
|
+
isSystem: true,
|
|
251
|
+
},
|
|
252
|
+
CartStatus: {
|
|
253
|
+
lookupName: "CartStatus",
|
|
254
|
+
values: {},
|
|
255
|
+
isActive: true,
|
|
256
|
+
isSystem: true,
|
|
257
|
+
},
|
|
258
|
+
},
|
|
232
259
|
list: [],
|
|
233
260
|
},
|
|
234
261
|
},
|
|
@@ -237,11 +264,27 @@ describe("metadata", () => {
|
|
|
237
264
|
});
|
|
238
265
|
|
|
239
266
|
it("save order metadata success", () => {
|
|
240
|
-
const
|
|
241
|
-
|
|
267
|
+
const oldState = Immutable.fromJS({
|
|
268
|
+
lookups: {
|
|
269
|
+
order: {
|
|
270
|
+
index: {
|
|
271
|
+
CartStatus: {
|
|
272
|
+
lookupName: "CartStatus",
|
|
273
|
+
values: {},
|
|
274
|
+
isActive: true,
|
|
275
|
+
isSystem: true,
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
list: [],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
const action = {
|
|
283
|
+
type: SAVE_ORDER_LOOKUP_SUCCESS,
|
|
284
|
+
payload: {
|
|
242
285
|
lookupName: "CanceledStatusReasons",
|
|
243
|
-
values:
|
|
244
|
-
|
|
286
|
+
values: [
|
|
287
|
+
{
|
|
245
288
|
id: "e16d07f847284775b77cfb985724cf58",
|
|
246
289
|
value: "CanceledReason1",
|
|
247
290
|
lookupId: "CanceledStatusReasons",
|
|
@@ -249,7 +292,7 @@ describe("metadata", () => {
|
|
|
249
292
|
isActive: true,
|
|
250
293
|
isSystem: true,
|
|
251
294
|
},
|
|
252
|
-
|
|
295
|
+
{
|
|
253
296
|
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
254
297
|
value: "CanceledReason2",
|
|
255
298
|
lookupId: "CanceledStatusReasons",
|
|
@@ -257,29 +300,10 @@ describe("metadata", () => {
|
|
|
257
300
|
isActive: true,
|
|
258
301
|
isSystem: true,
|
|
259
302
|
},
|
|
260
|
-
|
|
303
|
+
],
|
|
261
304
|
isActive: true,
|
|
262
305
|
isSystem: true,
|
|
263
306
|
},
|
|
264
|
-
CartStatus: {
|
|
265
|
-
lookupName: "CartStatus",
|
|
266
|
-
values: {},
|
|
267
|
-
isActive: true,
|
|
268
|
-
isSystem: true,
|
|
269
|
-
},
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
const oldState = Immutable.fromJS({
|
|
273
|
-
lookups: {
|
|
274
|
-
order: {
|
|
275
|
-
index: { CartStatus: lookups.CartStatus },
|
|
276
|
-
list: [],
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
});
|
|
280
|
-
const action = {
|
|
281
|
-
type: SAVE_ORDER_LOOKUP_SUCCESS,
|
|
282
|
-
payload: lookups.CanceledStatusReasons,
|
|
283
307
|
};
|
|
284
308
|
const newState = reducer(oldState, action);
|
|
285
309
|
return expect(newState, "not to be", oldState).and(
|
|
@@ -287,7 +311,37 @@ describe("metadata", () => {
|
|
|
287
311
|
Immutable.fromJS({
|
|
288
312
|
lookups: {
|
|
289
313
|
order: {
|
|
290
|
-
index:
|
|
314
|
+
index: {
|
|
315
|
+
CanceledStatusReasons: {
|
|
316
|
+
lookupName: "CanceledStatusReasons",
|
|
317
|
+
values: {
|
|
318
|
+
CanceledReason1: {
|
|
319
|
+
id: "e16d07f847284775b77cfb985724cf58",
|
|
320
|
+
value: "CanceledReason1",
|
|
321
|
+
lookupId: "CanceledStatusReasons",
|
|
322
|
+
sortOrder: 0,
|
|
323
|
+
isActive: true,
|
|
324
|
+
isSystem: true,
|
|
325
|
+
},
|
|
326
|
+
CanceledReason2: {
|
|
327
|
+
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
328
|
+
value: "CanceledReason2",
|
|
329
|
+
lookupId: "CanceledStatusReasons",
|
|
330
|
+
sortOrder: 0,
|
|
331
|
+
isActive: true,
|
|
332
|
+
isSystem: true,
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
isActive: true,
|
|
336
|
+
isSystem: true,
|
|
337
|
+
},
|
|
338
|
+
CartStatus: {
|
|
339
|
+
lookupName: "CartStatus",
|
|
340
|
+
values: {},
|
|
341
|
+
isActive: true,
|
|
342
|
+
isSystem: true,
|
|
343
|
+
},
|
|
344
|
+
},
|
|
291
345
|
list: [],
|
|
292
346
|
},
|
|
293
347
|
},
|
|
@@ -296,11 +350,27 @@ describe("metadata", () => {
|
|
|
296
350
|
});
|
|
297
351
|
|
|
298
352
|
it("add order metadata success", () => {
|
|
299
|
-
const
|
|
300
|
-
|
|
353
|
+
const oldState = Immutable.fromJS({
|
|
354
|
+
lookups: {
|
|
355
|
+
order: {
|
|
356
|
+
index: {
|
|
357
|
+
CartStatus: {
|
|
358
|
+
lookupName: "CartStatus",
|
|
359
|
+
values: {},
|
|
360
|
+
isActive: true,
|
|
361
|
+
isSystem: true,
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
list: [],
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
const action = {
|
|
369
|
+
type: ADD_ORDER_LOOKUP_SUCCESS,
|
|
370
|
+
payload: {
|
|
301
371
|
lookupName: "NewStatusReasons",
|
|
302
|
-
values:
|
|
303
|
-
|
|
372
|
+
values: [
|
|
373
|
+
{
|
|
304
374
|
id: "e16d07f847284775b77cfb985724cf58",
|
|
305
375
|
value: "CanceledReason1",
|
|
306
376
|
lookupId: "CanceledStatusReasons",
|
|
@@ -308,7 +378,7 @@ describe("metadata", () => {
|
|
|
308
378
|
isActive: true,
|
|
309
379
|
isSystem: true,
|
|
310
380
|
},
|
|
311
|
-
|
|
381
|
+
{
|
|
312
382
|
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
313
383
|
value: "CanceledReason2",
|
|
314
384
|
lookupId: "CanceledStatusReasons",
|
|
@@ -316,37 +386,48 @@ describe("metadata", () => {
|
|
|
316
386
|
isActive: true,
|
|
317
387
|
isSystem: true,
|
|
318
388
|
},
|
|
319
|
-
|
|
320
|
-
isActive: true,
|
|
321
|
-
isSystem: true,
|
|
322
|
-
},
|
|
323
|
-
CartStatus: {
|
|
324
|
-
lookupName: "CartStatus",
|
|
325
|
-
values: {},
|
|
389
|
+
],
|
|
326
390
|
isActive: true,
|
|
327
391
|
isSystem: true,
|
|
328
392
|
},
|
|
329
393
|
};
|
|
330
|
-
|
|
331
|
-
const oldState = Immutable.fromJS({
|
|
332
|
-
lookups: {
|
|
333
|
-
order: {
|
|
334
|
-
index: { CartStatus: lookups.CartStatus },
|
|
335
|
-
list: [],
|
|
336
|
-
},
|
|
337
|
-
},
|
|
338
|
-
});
|
|
339
|
-
const action = {
|
|
340
|
-
type: ADD_ORDER_LOOKUP_SUCCESS,
|
|
341
|
-
payload: lookups.NewStatusReasons,
|
|
342
|
-
};
|
|
343
394
|
const newState = reducer(oldState, action);
|
|
344
395
|
return expect(newState, "not to be", oldState).and(
|
|
345
396
|
"to equal",
|
|
346
397
|
Immutable.fromJS({
|
|
347
398
|
lookups: {
|
|
348
399
|
order: {
|
|
349
|
-
index:
|
|
400
|
+
index: {
|
|
401
|
+
NewStatusReasons: {
|
|
402
|
+
lookupName: "NewStatusReasons",
|
|
403
|
+
values: {
|
|
404
|
+
CanceledReason1: {
|
|
405
|
+
id: "e16d07f847284775b77cfb985724cf58",
|
|
406
|
+
value: "CanceledReason1",
|
|
407
|
+
lookupId: "CanceledStatusReasons",
|
|
408
|
+
sortOrder: 0,
|
|
409
|
+
isActive: true,
|
|
410
|
+
isSystem: true,
|
|
411
|
+
},
|
|
412
|
+
CanceledReason2: {
|
|
413
|
+
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
414
|
+
value: "CanceledReason2",
|
|
415
|
+
lookupId: "CanceledStatusReasons",
|
|
416
|
+
sortOrder: 0,
|
|
417
|
+
isActive: true,
|
|
418
|
+
isSystem: true,
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
isActive: true,
|
|
422
|
+
isSystem: true,
|
|
423
|
+
},
|
|
424
|
+
CartStatus: {
|
|
425
|
+
lookupName: "CartStatus",
|
|
426
|
+
values: {},
|
|
427
|
+
isActive: true,
|
|
428
|
+
isSystem: true,
|
|
429
|
+
},
|
|
430
|
+
},
|
|
350
431
|
list: ["CartStatus", "NewStatusReasons"],
|
|
351
432
|
totalCount: 2,
|
|
352
433
|
},
|
|
@@ -745,11 +826,27 @@ describe("metadata", () => {
|
|
|
745
826
|
});
|
|
746
827
|
|
|
747
828
|
it("get customer lookup success", () => {
|
|
748
|
-
const
|
|
749
|
-
|
|
829
|
+
const oldState = Immutable.fromJS({
|
|
830
|
+
lookups: {
|
|
831
|
+
customer: {
|
|
832
|
+
index: {
|
|
833
|
+
CartStatus: {
|
|
834
|
+
lookupName: "CartStatus",
|
|
835
|
+
values: {},
|
|
836
|
+
isActive: true,
|
|
837
|
+
isSystem: true,
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
list: [],
|
|
841
|
+
},
|
|
842
|
+
},
|
|
843
|
+
});
|
|
844
|
+
const action = {
|
|
845
|
+
type: GET_CUSTOMER_LOOKUP_SUCCESS,
|
|
846
|
+
payload: {
|
|
750
847
|
lookupName: "CanceledStatusReasons",
|
|
751
|
-
values:
|
|
752
|
-
|
|
848
|
+
values: [
|
|
849
|
+
{
|
|
753
850
|
id: "e16d07f847284775b77cfb985724cf58",
|
|
754
851
|
value: "CanceledReason1",
|
|
755
852
|
lookupId: "CanceledStatusReasons",
|
|
@@ -757,7 +854,7 @@ describe("metadata", () => {
|
|
|
757
854
|
isActive: true,
|
|
758
855
|
isSystem: true,
|
|
759
856
|
},
|
|
760
|
-
|
|
857
|
+
{
|
|
761
858
|
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
762
859
|
value: "CanceledReason2",
|
|
763
860
|
lookupId: "CanceledStatusReasons",
|
|
@@ -765,37 +862,48 @@ describe("metadata", () => {
|
|
|
765
862
|
isActive: true,
|
|
766
863
|
isSystem: true,
|
|
767
864
|
},
|
|
768
|
-
|
|
769
|
-
isActive: true,
|
|
770
|
-
isSystem: true,
|
|
771
|
-
},
|
|
772
|
-
CartStatus: {
|
|
773
|
-
lookupName: "CartStatus",
|
|
774
|
-
values: {},
|
|
865
|
+
],
|
|
775
866
|
isActive: true,
|
|
776
867
|
isSystem: true,
|
|
777
868
|
},
|
|
778
869
|
};
|
|
779
|
-
|
|
780
|
-
const oldState = Immutable.fromJS({
|
|
781
|
-
lookups: {
|
|
782
|
-
customer: {
|
|
783
|
-
index: { CartStatus: lookups.CartStatus },
|
|
784
|
-
list: [],
|
|
785
|
-
},
|
|
786
|
-
},
|
|
787
|
-
});
|
|
788
|
-
const action = {
|
|
789
|
-
type: GET_CUSTOMER_LOOKUP_SUCCESS,
|
|
790
|
-
payload: lookups.CanceledStatusReasons,
|
|
791
|
-
};
|
|
792
870
|
const newState = reducer(oldState, action);
|
|
793
871
|
return expect(newState, "not to be", oldState).and(
|
|
794
872
|
"to equal",
|
|
795
873
|
Immutable.fromJS({
|
|
796
874
|
lookups: {
|
|
797
875
|
customer: {
|
|
798
|
-
index:
|
|
876
|
+
index: {
|
|
877
|
+
CanceledStatusReasons: {
|
|
878
|
+
lookupName: "CanceledStatusReasons",
|
|
879
|
+
values: {
|
|
880
|
+
CanceledReason1: {
|
|
881
|
+
id: "e16d07f847284775b77cfb985724cf58",
|
|
882
|
+
value: "CanceledReason1",
|
|
883
|
+
lookupId: "CanceledStatusReasons",
|
|
884
|
+
sortOrder: 0,
|
|
885
|
+
isActive: true,
|
|
886
|
+
isSystem: true,
|
|
887
|
+
},
|
|
888
|
+
CanceledReason2: {
|
|
889
|
+
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
890
|
+
value: "CanceledReason2",
|
|
891
|
+
lookupId: "CanceledStatusReasons",
|
|
892
|
+
sortOrder: 0,
|
|
893
|
+
isActive: true,
|
|
894
|
+
isSystem: true,
|
|
895
|
+
},
|
|
896
|
+
},
|
|
897
|
+
isActive: true,
|
|
898
|
+
isSystem: true,
|
|
899
|
+
},
|
|
900
|
+
CartStatus: {
|
|
901
|
+
lookupName: "CartStatus",
|
|
902
|
+
values: {},
|
|
903
|
+
isActive: true,
|
|
904
|
+
isSystem: true,
|
|
905
|
+
},
|
|
906
|
+
},
|
|
799
907
|
list: [],
|
|
800
908
|
},
|
|
801
909
|
},
|
|
@@ -804,11 +912,27 @@ describe("metadata", () => {
|
|
|
804
912
|
});
|
|
805
913
|
|
|
806
914
|
it("save customer metadata success", () => {
|
|
807
|
-
const
|
|
808
|
-
|
|
915
|
+
const oldState = Immutable.fromJS({
|
|
916
|
+
lookups: {
|
|
917
|
+
customer: {
|
|
918
|
+
index: {
|
|
919
|
+
CartStatus: {
|
|
920
|
+
lookupName: "CartStatus",
|
|
921
|
+
values: {},
|
|
922
|
+
isActive: true,
|
|
923
|
+
isSystem: true,
|
|
924
|
+
},
|
|
925
|
+
},
|
|
926
|
+
list: [],
|
|
927
|
+
},
|
|
928
|
+
},
|
|
929
|
+
});
|
|
930
|
+
const action = {
|
|
931
|
+
type: SAVE_CUSTOMER_LOOKUP_SUCCESS,
|
|
932
|
+
payload: {
|
|
809
933
|
lookupName: "CanceledStatusReasons",
|
|
810
|
-
values:
|
|
811
|
-
|
|
934
|
+
values: [
|
|
935
|
+
{
|
|
812
936
|
id: "e16d07f847284775b77cfb985724cf58",
|
|
813
937
|
value: "CanceledReason1",
|
|
814
938
|
lookupId: "CanceledStatusReasons",
|
|
@@ -816,7 +940,7 @@ describe("metadata", () => {
|
|
|
816
940
|
isActive: true,
|
|
817
941
|
isSystem: true,
|
|
818
942
|
},
|
|
819
|
-
|
|
943
|
+
{
|
|
820
944
|
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
821
945
|
value: "CanceledReason2",
|
|
822
946
|
lookupId: "CanceledStatusReasons",
|
|
@@ -824,29 +948,10 @@ describe("metadata", () => {
|
|
|
824
948
|
isActive: true,
|
|
825
949
|
isSystem: true,
|
|
826
950
|
},
|
|
827
|
-
|
|
951
|
+
],
|
|
828
952
|
isActive: true,
|
|
829
953
|
isSystem: true,
|
|
830
954
|
},
|
|
831
|
-
CartStatus: {
|
|
832
|
-
lookupName: "CartStatus",
|
|
833
|
-
values: {},
|
|
834
|
-
isActive: true,
|
|
835
|
-
isSystem: true,
|
|
836
|
-
},
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
const oldState = Immutable.fromJS({
|
|
840
|
-
lookups: {
|
|
841
|
-
customer: {
|
|
842
|
-
index: { CartStatus: lookups.CartStatus },
|
|
843
|
-
list: [],
|
|
844
|
-
},
|
|
845
|
-
},
|
|
846
|
-
});
|
|
847
|
-
const action = {
|
|
848
|
-
type: SAVE_CUSTOMER_LOOKUP_SUCCESS,
|
|
849
|
-
payload: lookups.CanceledStatusReasons,
|
|
850
955
|
};
|
|
851
956
|
const newState = reducer(oldState, action);
|
|
852
957
|
return expect(newState, "not to be", oldState).and(
|
|
@@ -854,7 +959,37 @@ describe("metadata", () => {
|
|
|
854
959
|
Immutable.fromJS({
|
|
855
960
|
lookups: {
|
|
856
961
|
customer: {
|
|
857
|
-
index:
|
|
962
|
+
index: {
|
|
963
|
+
CanceledStatusReasons: {
|
|
964
|
+
lookupName: "CanceledStatusReasons",
|
|
965
|
+
values: {
|
|
966
|
+
CanceledReason1: {
|
|
967
|
+
id: "e16d07f847284775b77cfb985724cf58",
|
|
968
|
+
value: "CanceledReason1",
|
|
969
|
+
lookupId: "CanceledStatusReasons",
|
|
970
|
+
sortOrder: 0,
|
|
971
|
+
isActive: true,
|
|
972
|
+
isSystem: true,
|
|
973
|
+
},
|
|
974
|
+
CanceledReason2: {
|
|
975
|
+
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
976
|
+
value: "CanceledReason2",
|
|
977
|
+
lookupId: "CanceledStatusReasons",
|
|
978
|
+
sortOrder: 0,
|
|
979
|
+
isActive: true,
|
|
980
|
+
isSystem: true,
|
|
981
|
+
},
|
|
982
|
+
},
|
|
983
|
+
isActive: true,
|
|
984
|
+
isSystem: true,
|
|
985
|
+
},
|
|
986
|
+
CartStatus: {
|
|
987
|
+
lookupName: "CartStatus",
|
|
988
|
+
values: {},
|
|
989
|
+
isActive: true,
|
|
990
|
+
isSystem: true,
|
|
991
|
+
},
|
|
992
|
+
},
|
|
858
993
|
list: [],
|
|
859
994
|
},
|
|
860
995
|
},
|
|
@@ -863,11 +998,27 @@ describe("metadata", () => {
|
|
|
863
998
|
});
|
|
864
999
|
|
|
865
1000
|
it("add customer metadata success", () => {
|
|
866
|
-
const
|
|
867
|
-
|
|
1001
|
+
const oldState = Immutable.fromJS({
|
|
1002
|
+
lookups: {
|
|
1003
|
+
customer: {
|
|
1004
|
+
index: {
|
|
1005
|
+
CartStatus: {
|
|
1006
|
+
lookupName: "CartStatus",
|
|
1007
|
+
values: {},
|
|
1008
|
+
isActive: true,
|
|
1009
|
+
isSystem: true,
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
1012
|
+
list: [],
|
|
1013
|
+
},
|
|
1014
|
+
},
|
|
1015
|
+
});
|
|
1016
|
+
const action = {
|
|
1017
|
+
type: ADD_CUSTOMER_LOOKUP_SUCCESS,
|
|
1018
|
+
payload: {
|
|
868
1019
|
lookupName: "NewStatusReasons",
|
|
869
|
-
values:
|
|
870
|
-
|
|
1020
|
+
values: [
|
|
1021
|
+
{
|
|
871
1022
|
id: "e16d07f847284775b77cfb985724cf58",
|
|
872
1023
|
value: "CanceledReason1",
|
|
873
1024
|
lookupId: "CanceledStatusReasons",
|
|
@@ -875,7 +1026,7 @@ describe("metadata", () => {
|
|
|
875
1026
|
isActive: true,
|
|
876
1027
|
isSystem: true,
|
|
877
1028
|
},
|
|
878
|
-
|
|
1029
|
+
{
|
|
879
1030
|
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
880
1031
|
value: "CanceledReason2",
|
|
881
1032
|
lookupId: "CanceledStatusReasons",
|
|
@@ -883,37 +1034,48 @@ describe("metadata", () => {
|
|
|
883
1034
|
isActive: true,
|
|
884
1035
|
isSystem: true,
|
|
885
1036
|
},
|
|
886
|
-
|
|
887
|
-
isActive: true,
|
|
888
|
-
isSystem: true,
|
|
889
|
-
},
|
|
890
|
-
CartStatus: {
|
|
891
|
-
lookupName: "CartStatus",
|
|
892
|
-
values: {},
|
|
1037
|
+
],
|
|
893
1038
|
isActive: true,
|
|
894
1039
|
isSystem: true,
|
|
895
1040
|
},
|
|
896
1041
|
};
|
|
897
|
-
|
|
898
|
-
const oldState = Immutable.fromJS({
|
|
899
|
-
lookups: {
|
|
900
|
-
customer: {
|
|
901
|
-
index: { CartStatus: lookups.CartStatus },
|
|
902
|
-
list: [],
|
|
903
|
-
},
|
|
904
|
-
},
|
|
905
|
-
});
|
|
906
|
-
const action = {
|
|
907
|
-
type: ADD_CUSTOMER_LOOKUP_SUCCESS,
|
|
908
|
-
payload: lookups.NewStatusReasons,
|
|
909
|
-
};
|
|
910
1042
|
const newState = reducer(oldState, action);
|
|
911
1043
|
return expect(newState, "not to be", oldState).and(
|
|
912
1044
|
"to equal",
|
|
913
1045
|
Immutable.fromJS({
|
|
914
1046
|
lookups: {
|
|
915
1047
|
customer: {
|
|
916
|
-
index:
|
|
1048
|
+
index: {
|
|
1049
|
+
NewStatusReasons: {
|
|
1050
|
+
lookupName: "NewStatusReasons",
|
|
1051
|
+
values: {
|
|
1052
|
+
CanceledReason1: {
|
|
1053
|
+
id: "e16d07f847284775b77cfb985724cf58",
|
|
1054
|
+
value: "CanceledReason1",
|
|
1055
|
+
lookupId: "CanceledStatusReasons",
|
|
1056
|
+
sortOrder: 0,
|
|
1057
|
+
isActive: true,
|
|
1058
|
+
isSystem: true,
|
|
1059
|
+
},
|
|
1060
|
+
CanceledReason2: {
|
|
1061
|
+
id: "6bbfe77703c745d68b8eaceb9cd484b1",
|
|
1062
|
+
value: "CanceledReason2",
|
|
1063
|
+
lookupId: "CanceledStatusReasons",
|
|
1064
|
+
sortOrder: 0,
|
|
1065
|
+
isActive: true,
|
|
1066
|
+
isSystem: true,
|
|
1067
|
+
},
|
|
1068
|
+
},
|
|
1069
|
+
isActive: true,
|
|
1070
|
+
isSystem: true,
|
|
1071
|
+
},
|
|
1072
|
+
CartStatus: {
|
|
1073
|
+
lookupName: "CartStatus",
|
|
1074
|
+
values: {},
|
|
1075
|
+
isActive: true,
|
|
1076
|
+
isSystem: true,
|
|
1077
|
+
},
|
|
1078
|
+
},
|
|
917
1079
|
list: ["CartStatus", "NewStatusReasons"],
|
|
918
1080
|
totalCount: 2,
|
|
919
1081
|
},
|