@contrail/flexplm 1.3.0-alpha.0 → 1.3.0-alpha.3

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 (123) hide show
  1. package/.github/pull_request_template.md +31 -31
  2. package/.github/workflows/flexplm-lib.yml +27 -27
  3. package/CHANGELOG.md +1 -1
  4. package/lib/entity-processor/base-entity-processor.d.ts +42 -0
  5. package/lib/entity-processor/base-entity-processor.js +377 -0
  6. package/lib/entity-processor/base-entity-processor.spec.d.ts +1 -0
  7. package/lib/entity-processor/base-entity-processor.spec.js +426 -0
  8. package/lib/flexplm-request.d.ts +3 -0
  9. package/lib/flexplm-request.js +34 -0
  10. package/lib/flexplm-utils.d.ts +5 -0
  11. package/lib/flexplm-utils.js +33 -0
  12. package/lib/flexplm-utils.spec.d.ts +1 -0
  13. package/lib/flexplm-utils.spec.js +26 -0
  14. package/lib/index.d.ts +22 -0
  15. package/lib/index.js +38 -0
  16. package/lib/interfaces/interfaces.d.ts +105 -0
  17. package/lib/interfaces/interfaces.js +2 -0
  18. package/lib/interfaces/item-family-changes.d.ts +20 -0
  19. package/lib/interfaces/item-family-changes.js +56 -0
  20. package/lib/interfaces/publish-change-data.d.ts +19 -0
  21. package/lib/interfaces/publish-change-data.js +32 -0
  22. package/lib/publish/base-process-publish-assortment-callback.d.ts +9 -0
  23. package/lib/publish/base-process-publish-assortment-callback.js +38 -0
  24. package/lib/publish/base-process-publish-assortment.d.ts +93 -0
  25. package/lib/publish/base-process-publish-assortment.js +944 -0
  26. package/lib/publish/base-process-publish-assortment.spec.d.ts +1 -0
  27. package/lib/publish/base-process-publish-assortment.spec.js +1670 -0
  28. package/lib/publish/mockData.d.ts +1389 -0
  29. package/lib/publish/mockData.js +4519 -0
  30. package/lib/transform/identifier-conversion-spec-mockData.d.ts +0 -0
  31. package/lib/transform/identifier-conversion-spec-mockData.js +444 -0
  32. package/lib/transform/identifier-conversion.d.ts +15 -0
  33. package/lib/transform/identifier-conversion.js +212 -0
  34. package/lib/transform/identifier-conversion.spec.d.ts +1 -0
  35. package/lib/transform/identifier-conversion.spec.js +339 -0
  36. package/lib/util/config-defaults.d.ts +8 -0
  37. package/lib/util/config-defaults.js +85 -0
  38. package/lib/util/config-defaults.spec.d.ts +1 -0
  39. package/lib/util/config-defaults.spec.js +293 -0
  40. package/lib/util/data-converter-spec-mockData.d.ts +0 -0
  41. package/lib/util/data-converter-spec-mockData.js +205 -0
  42. package/lib/util/data-converter.d.ts +39 -0
  43. package/lib/util/data-converter.js +592 -0
  44. package/lib/util/data-converter.spec.d.ts +1 -0
  45. package/lib/util/data-converter.spec.js +904 -0
  46. package/lib/util/error-response-object.d.ts +4 -0
  47. package/lib/util/error-response-object.js +47 -0
  48. package/lib/util/error-response-object.spec.d.ts +1 -0
  49. package/lib/util/error-response-object.spec.js +99 -0
  50. package/lib/util/event-short-message-status.d.ts +18 -0
  51. package/lib/util/event-short-message-status.js +22 -0
  52. package/lib/util/federation.d.ts +15 -0
  53. package/lib/util/federation.js +149 -0
  54. package/lib/util/flexplm-connect.d.ts +22 -0
  55. package/lib/util/flexplm-connect.js +176 -0
  56. package/lib/util/flexplm-connect.spec.d.ts +1 -0
  57. package/lib/util/flexplm-connect.spec.js +88 -0
  58. package/lib/util/logger-config.d.ts +1 -0
  59. package/lib/util/logger-config.js +26 -0
  60. package/lib/util/map-util-spec-mockData.d.ts +0 -0
  61. package/lib/util/map-util-spec-mockData.js +205 -0
  62. package/lib/util/map-utils.d.ts +6 -0
  63. package/lib/util/map-utils.js +15 -0
  64. package/lib/util/map-utils.spec.d.ts +1 -0
  65. package/lib/util/map-utils.spec.js +89 -0
  66. package/lib/util/mockData.d.ts +79 -0
  67. package/lib/util/mockData.js +99 -0
  68. package/lib/util/thumbnail-util.d.ts +28 -0
  69. package/lib/util/thumbnail-util.js +202 -0
  70. package/lib/util/thumbnail-util.spec.d.ts +1 -0
  71. package/lib/util/thumbnail-util.spec.js +398 -0
  72. package/lib/util/type-conversion-utils-spec-mockData.d.ts +0 -0
  73. package/lib/util/type-conversion-utils-spec-mockData.js +259 -0
  74. package/lib/util/type-conversion-utils.d.ts +23 -0
  75. package/lib/util/type-conversion-utils.js +266 -0
  76. package/lib/util/type-conversion-utils.spec.d.ts +1 -0
  77. package/lib/util/type-conversion-utils.spec.js +868 -0
  78. package/lib/util/type-defaults.d.ts +16 -0
  79. package/lib/util/type-defaults.js +221 -0
  80. package/lib/util/type-defaults.spec.d.ts +1 -0
  81. package/lib/util/type-defaults.spec.js +516 -0
  82. package/lib/util/type-utils.d.ts +13 -0
  83. package/lib/util/type-utils.js +114 -0
  84. package/lib/util/type-utils.spec.d.ts +1 -0
  85. package/lib/util/type-utils.spec.js +190 -0
  86. package/package.json +1 -1
  87. package/publish.bat +4 -4
  88. package/publish.sh +4 -4
  89. package/src/entity-processor/base-entity-processor.spec.ts +157 -0
  90. package/src/entity-processor/base-entity-processor.ts +21 -2
  91. package/src/flexplm-request.ts +28 -28
  92. package/src/flexplm-utils.spec.ts +27 -27
  93. package/src/flexplm-utils.ts +29 -29
  94. package/src/index.ts +21 -21
  95. package/src/interfaces/item-family-changes.ts +66 -66
  96. package/src/interfaces/publish-change-data.ts +42 -42
  97. package/src/publish/base-process-publish-assortment-callback.ts +50 -50
  98. package/src/transform/identifier-conversion-spec-mockData.ts +495 -495
  99. package/src/transform/identifier-conversion.spec.ts +353 -353
  100. package/src/transform/identifier-conversion.ts +281 -281
  101. package/src/util/config-defaults.spec.ts +350 -350
  102. package/src/util/config-defaults.ts +92 -92
  103. package/src/util/data-converter-spec-mockData.ts +230 -230
  104. package/src/util/error-response-object.spec.ts +115 -115
  105. package/src/util/error-response-object.ts +49 -49
  106. package/src/util/federation.ts +172 -172
  107. package/src/util/logger-config.ts +19 -19
  108. package/src/util/map-util-spec-mockData.ts +230 -230
  109. package/src/util/map-utils.spec.ts +102 -102
  110. package/src/util/map-utils.ts +40 -40
  111. package/src/util/mockData.ts +97 -97
  112. package/src/util/thumbnail-util.spec.ts +190 -0
  113. package/src/util/thumbnail-util.ts +109 -1
  114. package/src/util/type-conversion-utils.spec.ts +25 -25
  115. package/src/util/type-conversion-utils.ts +10 -9
  116. package/src/util/type-defaults.spec.ts +668 -668
  117. package/src/util/type-defaults.ts +280 -280
  118. package/src/util/type-utils.spec.ts +227 -227
  119. package/src/util/type-utils.ts +144 -144
  120. package/tsconfig.json +28 -26
  121. package/tslint.json +57 -57
  122. package/scripts/output.png +0 -0
  123. package/scripts/test-get-request.ts +0 -35
@@ -1,669 +1,669 @@
1
- import { MapFileUtil } from "@contrail/transform-data";
2
- import { TypeDefaults } from "./type-defaults";
3
- import { Entities } from "@contrail/sdk";
4
-
5
- describe('Type Defaults', () =>{
6
- describe('getDefaultObjectClass', () => {
7
- it('LCSProduct', () => {
8
- const newData = {
9
- entityType: 'item',
10
- roles: ['family']
11
- };
12
-
13
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
14
-
15
- expect(objectClass).toEqual('LCSProduct');
16
-
17
- });
18
-
19
- it('LCSSKU', () => {
20
- const newData = {
21
- entityType: 'item',
22
- roles: ['color']
23
- };
24
-
25
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
26
-
27
- expect(objectClass).toEqual('LCSSKU');
28
- });
29
-
30
- it('LCSProductSeasonLink', () => {
31
- const newData = {
32
- entityType: 'project-item',
33
- roles: ['family']
34
- };
35
-
36
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
37
-
38
- expect(objectClass).toEqual('LCSProductSeasonLink');
39
- });
40
-
41
- it('LCSSKUSeasonLink', () => {
42
- const newData = {
43
- entityType: 'project-item',
44
- roles: ['color']
45
- };
46
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
47
-
48
- expect(objectClass).toEqual('LCSSKUSeasonLink');
49
- });
50
- it('LCSColor', () => {
51
- const newData = {
52
- entityType: 'color'
53
- };
54
-
55
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
56
-
57
- expect(objectClass).toEqual('LCSColor');
58
- });
59
-
60
- it('LCSRevisableEntity', () => {
61
- const newData = {
62
- entityType: 'custom-entity'
63
- };
64
-
65
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
66
-
67
- expect(objectClass).toEqual('LCSRevisableEntity');
68
- });
69
-
70
- it('LCSSeason - project', () => {
71
- const newData = {
72
- entityType: 'project'
73
- };
74
-
75
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
76
-
77
- expect(objectClass).toEqual('LCSSeason');
78
- });
79
-
80
- it('Season Group', () => {
81
- const newData = {
82
- entityType: 'assortment'
83
- };
84
-
85
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
86
-
87
- expect(objectClass).toEqual('SeasonGroup');
88
- });
89
-
90
- it('LCSSeason - assortment - publishToFlexPLM=true', () => {
91
- const newData = {
92
- entityType: 'assortment',
93
- publishToFlexPLM: true
94
- };
95
-
96
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
97
-
98
- expect(objectClass).toEqual('LCSSeason');
99
- });
100
-
101
- it('LCSSeason - assortment - publishToFlexPLM=true', () => {
102
- const newData = {
103
- entityType: 'assortment',
104
- flex2vibeMapKeyRoot: 'LCSSeason'
105
- };
106
-
107
- const objectClass = TypeDefaults.getDefaultObjectClass(newData);
108
-
109
- expect(objectClass).toEqual('LCSSeason');
110
- });
111
- });
112
-
113
- describe('getDefaultObjectTypePath', () =>{
114
- it('item-family', () =>{
115
- const newData = {
116
- entityType: 'item',
117
- roles: ['family']
118
- };
119
-
120
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
121
- expect(typePath).toEqual('Product');
122
- });
123
-
124
- it('item-color', () =>{
125
- const newData = {
126
- entityType: 'item',
127
- roles: ['color']
128
- };
129
-
130
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
131
- expect(typePath).toEqual('Product');
132
- });
133
-
134
- it('project-item-family', () =>{
135
- const newData = {
136
- entityType: 'project-item',
137
- roles: ['family']
138
- };
139
-
140
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
141
- expect(typePath).toEqual('Product');
142
- });
143
-
144
- it('project-item-color', () =>{
145
- const newData = {
146
- entityType: 'project-item',
147
- roles: ['color']
148
- };
149
-
150
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
151
- expect(typePath).toEqual('Product');
152
- });
153
-
154
- it('color', () =>{
155
- const newData = {
156
- entityType: 'color'
157
- };
158
-
159
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
160
- expect(typePath).toEqual('Color');
161
- });
162
-
163
- it('custom-entity', () =>{
164
- const newData = {
165
- entityType: 'custom-entity'
166
- };
167
-
168
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
169
- expect(typePath).toEqual('Revisable Entity');
170
- });
171
-
172
- it('project', () =>{
173
- const newData = {
174
- entityType: 'project'
175
- };
176
-
177
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
178
- expect(typePath).toEqual('Season');
179
- });
180
-
181
- it('assortment', () =>{
182
- const newData = {
183
- entityType: 'assortment'
184
- };
185
-
186
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
187
- expect(typePath).toEqual('Season Group');
188
- });
189
-
190
- it('assortment - publishToFlexPLM=true', () =>{
191
- const newData = {
192
- entityType: 'assortment',
193
- publishToFlexPLM: true
194
- };
195
-
196
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
197
- expect(typePath).toEqual('Season');
198
- });
199
-
200
- it('assortment - flex2vibeMapKeyRoot=LCSSeason', () =>{
201
- const newData = {
202
- entityType: 'assortment',
203
- flex2vibeMapKeyRoot: 'LCSSeason'
204
- };
205
-
206
- const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
207
- expect(typePath).toEqual('Season');
208
- });
209
- });
210
-
211
- describe('getDefaultIdentifiers', () =>{
212
- it('item-family', () =>{
213
- const newData = {
214
- entityType: 'item',
215
- roles: ['family']
216
- };
217
-
218
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
219
- expect(defaultIdentifiers).toContain('itemNumber');
220
- expect(defaultIdentifiers).toHaveLength(1);
221
- });
222
-
223
- it('item-color', () =>{
224
- const newData = {
225
- entityType: 'item',
226
- roles: ['color']
227
- };
228
-
229
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
230
- expect(defaultIdentifiers).toContain('itemNumber');
231
- expect(defaultIdentifiers).toHaveLength(1);
232
- });
233
-
234
- it('project', () =>{
235
- const newData = {
236
- entityType: 'project'
237
- };
238
-
239
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
240
- expect(defaultIdentifiers).toContain('flexPLMSeasonName');
241
- expect(defaultIdentifiers).toHaveLength(1);
242
- });
243
-
244
- it('assortment', () =>{
245
- const newData = {
246
- entityType: 'assortment'
247
- };
248
-
249
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
250
- expect(defaultIdentifiers).toContain('seasonGroupName');
251
- expect(defaultIdentifiers).toHaveLength(1);
252
- });
253
-
254
- it('assortment - publishToFlexPLM=true', () =>{
255
- const newData = {
256
- entityType: 'assortment',
257
- publishToFlexPLM: true
258
- };
259
-
260
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
261
- expect(defaultIdentifiers).toContain('flexPLMSeasonName');
262
- expect(defaultIdentifiers).toHaveLength(1);
263
- });
264
-
265
- it('assortment - flex2vibeMapKeyRoot=LCSSeason', () =>{
266
- const newData = {
267
- entityType: 'assortment',
268
- flex2vibeMapKeyRoot: 'LCSSeason'
269
- };
270
-
271
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
272
- expect(defaultIdentifiers).toContain('flexPLMSeasonName');
273
- expect(defaultIdentifiers).toHaveLength(1);
274
- });
275
-
276
- it('color', () =>{
277
- const newData = {
278
- entityType: 'color'
279
- };
280
-
281
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
282
- expect(defaultIdentifiers).toContain('name');
283
- expect(defaultIdentifiers).toHaveLength(1);
284
- });
285
-
286
- it('custom-entity', () =>{
287
-
288
- const newData = {
289
- entityType: 'custom-entity'
290
- };
291
-
292
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
293
- expect(defaultIdentifiers).toContain('name');
294
- expect(defaultIdentifiers).toHaveLength(1);
295
- });
296
- });
297
-
298
- describe('getDefaultInformationalProperties', () =>{
299
- it('item-family', () =>{
300
- const newData = {
301
- entityType: 'item',
302
- roles: ['family']
303
- };
304
-
305
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
306
- expect(defaultIdentifiers).toContain('name');
307
- expect(defaultIdentifiers).toHaveLength(1);
308
- });
309
-
310
- it('item-color', () =>{
311
- const newData = {
312
- entityType: 'item',
313
- roles: ['color']
314
- };
315
-
316
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
317
- expect(defaultIdentifiers).toContain('optionName');
318
- expect(defaultIdentifiers).toHaveLength(1);
319
- });
320
-
321
- it('project', () =>{
322
- const newData = {
323
- entityType: 'project'
324
- };
325
-
326
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
327
- expect(defaultIdentifiers).toContain('name');
328
- expect(defaultIdentifiers).toHaveLength(1);
329
- });
330
-
331
- it('assortment', () =>{
332
- const newData = {
333
- entityType: 'assortment'
334
- };
335
-
336
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
337
- expect(defaultIdentifiers).toContain('name');
338
- expect(defaultIdentifiers).toHaveLength(1);
339
- });
340
-
341
-
342
- it('color', () =>{
343
- const newData = {
344
- entityType: 'color'
345
- };
346
-
347
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
348
- expect(defaultIdentifiers).toHaveLength(0);
349
- });
350
-
351
- it('custom-entity', () =>{
352
-
353
- const newData = {
354
- entityType: 'custom-entity'
355
- };
356
-
357
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
358
- expect(defaultIdentifiers).toHaveLength(0);
359
- });
360
- });
361
-
362
- describe('getEntityType', () =>{
363
- it('entityType', () =>{
364
- const entityType = 'item';
365
- const entity = {
366
- entityType
367
- };
368
-
369
- const results = TypeDefaults.getEntityType(entity);
370
- expect(results).toEqual(entityType);
371
- });
372
-
373
- it('entityType from type path', () =>{
374
- const entityType = 'item';
375
- const typePath = 'item:product:apparel';
376
- const entity = {
377
- typePath: typePath
378
- };
379
-
380
- const results = TypeDefaults.getEntityType(entity);
381
- expect(results).toEqual(entityType);
382
- });
383
-
384
- it('No entityType', () =>{
385
- const typePath = 'item:product:apparel';
386
- const entity = {
387
- someValue: typePath
388
- };
389
-
390
- expect(() =>TypeDefaults.getEntityType(entity)).toThrowError();
391
- expect(() =>TypeDefaults.getEntityType(entity)).toThrow(TypeDefaults.NO_ENTITY_TYPE);
392
-
393
- });
394
-
395
- });//getEntityType
396
-
397
- describe('getDefaultEntityClass', () =>{
398
- it('item - LCSProduct', () =>{
399
- const object = {
400
- flexPLMObjectClass: 'LCSProduct'
401
- };
402
-
403
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
404
-
405
- expect(entityClass).toBe('item');
406
- });
407
-
408
- it('item - LCSSKU', () =>{
409
- const object = {
410
- flexPLMObjectClass: 'LCSSKU'
411
- };
412
-
413
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
414
-
415
- expect(entityClass).toBe('item');
416
- });
417
-
418
- it('project-item - LCSProductSeasonLink', () =>{
419
- const object = {
420
- flexPLMObjectClass: 'LCSProductSeasonLink'
421
- };
422
-
423
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
424
-
425
- expect(entityClass).toBe('project-item');
426
- });
427
-
428
- it('project-item - LCSSKUSeasonLink', () =>{
429
- const object = {
430
- flexPLMObjectClass: 'LCSSKUSeasonLink'
431
- };
432
-
433
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
434
-
435
- expect(entityClass).toBe('project-item');
436
- });
437
-
438
- it('color - LCSColor', () =>{
439
- const object = {
440
- flexPLMObjectClass: 'LCSColor'
441
- };
442
-
443
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
444
-
445
- expect(entityClass).toBe('color');
446
- });
447
-
448
- it('assortment - LCSSeason', () =>{
449
- const object = {
450
- flexPLMObjectClass: 'LCSSeason'
451
- };
452
-
453
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
454
-
455
- expect(entityClass).toBe('assortment');
456
- });
457
-
458
- it('assortment - SeasonGroup', () =>{
459
- const object = {
460
- flexPLMObjectClass: 'SeasonGroup'
461
- };
462
-
463
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
464
-
465
- expect(entityClass).toBe('assortment');
466
- });
467
-
468
- it('custom-entity - LCSRevisableEntity', () =>{
469
- const object = {
470
- flexPLMObjectClass: 'LCSRevisableEntity'
471
- };
472
-
473
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
474
-
475
- expect(entityClass).toBe('custom-entity');
476
- });
477
-
478
- it('custom-entity - LCSLifecycleManaged', () =>{
479
- const object = {
480
- flexPLMObjectClass: 'LCSLifecycleManaged'
481
- };
482
-
483
- const entityClass = TypeDefaults.getDefaultEntityClass(object);
484
-
485
- expect(entityClass).toBe('custom-entity');
486
- });
487
-
488
- });//getDefaultEntityClass
489
-
490
- describe('getDefaultEntityTypePath', () =>{
491
- it('LCSProduct', () =>{
492
- const object = {
493
- flexPLMObjectClass: 'LCSProduct'
494
- };
495
-
496
- const typePath = TypeDefaults.getDefaultEntityTypePath(object);
497
- expect(typePath).toBe('item');
498
- });
499
-
500
- it('LCSSKU', () =>{
501
- const object = {
502
- flexPLMObjectClass: 'LCSSKU'
503
- };
504
-
505
- const typePath = TypeDefaults.getDefaultEntityTypePath(object);
506
- expect(typePath).toBe('item');
507
- });
508
- it('LCSProductSeasonLink', () =>{
509
- const object = {
510
- flexPLMObjectClass: 'LCSProductSeasonLink'
511
- };
512
-
513
- const typePath = TypeDefaults.getDefaultEntityTypePath(object);
514
- expect(typePath).toBe('project-item');
515
- });
516
-
517
- it('LCSSKUSeasonLink', () =>{
518
- const object = {
519
- flexPLMObjectClass: 'LCSSKUSeasonLink'
520
- };
521
-
522
- const typePath = TypeDefaults.getDefaultEntityTypePath(object);
523
- expect(typePath).toBe('project-item');
524
- });
525
-
526
- it('LCSColor', () =>{
527
- const object = {
528
- flexPLMObjectClass: 'LCSColor'
529
- };
530
-
531
- const typePath = TypeDefaults.getDefaultEntityTypePath(object);
532
- expect(typePath).toBe('color');
533
- });
534
-
535
- it('LCSSeason', () =>{
536
- const object = {
537
- flexPLMObjectClass: 'LCSSeason'
538
- };
539
-
540
- const typePath = TypeDefaults.getDefaultEntityTypePath(object);
541
- expect(typePath).toBe('assortment');
542
- });
543
-
544
- it('SeasonGroup', () =>{
545
- const object = {
546
- flexPLMObjectClass: 'SeasonGroup'
547
- };
548
-
549
- const typePath = TypeDefaults.getDefaultEntityTypePath(object);
550
- expect(typePath).toBe('assortment');
551
- });
552
- });//getDefaultEntityTypePath
553
-
554
- describe('getDefaultIdentifierPropertiesFromObject', () =>{
555
- it('LCSProduct', () =>{
556
- const object = {
557
- flexPLMObjectClass: 'LCSProduct'
558
- };
559
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
560
-
561
- expect(defaultIdentifiers).toContain('itemNumber');
562
- expect(defaultIdentifiers).toHaveLength(1);
563
- });
564
-
565
- it('LCSSKU', () =>{
566
- const object = {
567
- flexPLMObjectClass: 'LCSSKU'
568
- };
569
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
570
-
571
- expect(defaultIdentifiers).toContain('itemNumber');
572
- expect(defaultIdentifiers).toHaveLength(1);
573
- });
574
-
575
- it('LCSSeason', () =>{
576
- const object = {
577
- flexPLMObjectClass: 'LCSSeason'
578
- };
579
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
580
-
581
- expect(defaultIdentifiers).toContain('flexPLMSeasonName');
582
- expect(defaultIdentifiers).toHaveLength(1);
583
- });
584
-
585
- it('SeasonGroup', () =>{
586
- const object = {
587
- flexPLMObjectClass: 'SeasonGroup'
588
- };
589
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
590
-
591
- expect(defaultIdentifiers).toContain('seasonGroupName');
592
- expect(defaultIdentifiers).toHaveLength(1);
593
- });
594
-
595
- it('LCSColor', () =>{
596
- const object = {
597
- flexPLMObjectClass: 'LCSColor'
598
- };
599
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
600
-
601
- expect(defaultIdentifiers).toContain('name');
602
- expect(defaultIdentifiers).toHaveLength(1);
603
- });
604
-
605
- it('LCSRevisableEntity', () =>{
606
- const object = {
607
- flexPLMObjectClass: 'LCSRevisableEntity'
608
- };
609
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
610
-
611
- expect(defaultIdentifiers).toContain('name');
612
- expect(defaultIdentifiers).toHaveLength(1);
613
- });
614
-
615
- it('LCSLifecycleManaged', () =>{
616
- const object = {
617
- flexPLMObjectClass: 'LCSLifecycleManaged'
618
- };
619
- const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
620
-
621
- expect(defaultIdentifiers).toContain('name');
622
- expect(defaultIdentifiers).toHaveLength(1);
623
- });
624
-
625
- });//getDefaultIdentifierPropertiesFromObject
626
-
627
- describe('getDefaultInformationalPropertiesFromObject', () =>{
628
- it('LCSProduct', () =>{
629
- const object = {
630
- flexPLMObjectClass: 'LCSProduct'
631
- };
632
-
633
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
634
- expect(defaultIdentifiers).toContain('name');
635
- expect(defaultIdentifiers).toHaveLength(1);
636
- });
637
-
638
- it('LCSSKU', () =>{
639
- const object = {
640
- flexPLMObjectClass: 'LCSSKU'
641
- };
642
-
643
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
644
- expect(defaultIdentifiers).toContain('optionName');
645
- expect(defaultIdentifiers).toHaveLength(1);
646
- });
647
-
648
- it('LCSSeason', () =>{
649
- const object = {
650
- flexPLMObjectClass: 'LCSSeason'
651
- };
652
-
653
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
654
- expect(defaultIdentifiers).toContain('name');
655
- expect(defaultIdentifiers).toHaveLength(1);
656
- });
657
-
658
- it('SeasonGroup', () =>{
659
- const object = {
660
- flexPLMObjectClass: 'SeasonGroup'
661
- };
662
-
663
- const defaultIdentifiers = TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
664
- expect(defaultIdentifiers).toContain('name');
665
- expect(defaultIdentifiers).toHaveLength(1);
666
- });
667
-
668
- });//getDefaultInformationalPropertiesFromObject
1
+ import { MapFileUtil } from "@contrail/transform-data";
2
+ import { TypeDefaults } from "./type-defaults";
3
+ import { Entities } from "@contrail/sdk";
4
+
5
+ describe('Type Defaults', () =>{
6
+ describe('getDefaultObjectClass', () => {
7
+ it('LCSProduct', () => {
8
+ const newData = {
9
+ entityType: 'item',
10
+ roles: ['family']
11
+ };
12
+
13
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
14
+
15
+ expect(objectClass).toEqual('LCSProduct');
16
+
17
+ });
18
+
19
+ it('LCSSKU', () => {
20
+ const newData = {
21
+ entityType: 'item',
22
+ roles: ['color']
23
+ };
24
+
25
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
26
+
27
+ expect(objectClass).toEqual('LCSSKU');
28
+ });
29
+
30
+ it('LCSProductSeasonLink', () => {
31
+ const newData = {
32
+ entityType: 'project-item',
33
+ roles: ['family']
34
+ };
35
+
36
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
37
+
38
+ expect(objectClass).toEqual('LCSProductSeasonLink');
39
+ });
40
+
41
+ it('LCSSKUSeasonLink', () => {
42
+ const newData = {
43
+ entityType: 'project-item',
44
+ roles: ['color']
45
+ };
46
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
47
+
48
+ expect(objectClass).toEqual('LCSSKUSeasonLink');
49
+ });
50
+ it('LCSColor', () => {
51
+ const newData = {
52
+ entityType: 'color'
53
+ };
54
+
55
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
56
+
57
+ expect(objectClass).toEqual('LCSColor');
58
+ });
59
+
60
+ it('LCSRevisableEntity', () => {
61
+ const newData = {
62
+ entityType: 'custom-entity'
63
+ };
64
+
65
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
66
+
67
+ expect(objectClass).toEqual('LCSRevisableEntity');
68
+ });
69
+
70
+ it('LCSSeason - project', () => {
71
+ const newData = {
72
+ entityType: 'project'
73
+ };
74
+
75
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
76
+
77
+ expect(objectClass).toEqual('LCSSeason');
78
+ });
79
+
80
+ it('Season Group', () => {
81
+ const newData = {
82
+ entityType: 'assortment'
83
+ };
84
+
85
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
86
+
87
+ expect(objectClass).toEqual('SeasonGroup');
88
+ });
89
+
90
+ it('LCSSeason - assortment - publishToFlexPLM=true', () => {
91
+ const newData = {
92
+ entityType: 'assortment',
93
+ publishToFlexPLM: true
94
+ };
95
+
96
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
97
+
98
+ expect(objectClass).toEqual('LCSSeason');
99
+ });
100
+
101
+ it('LCSSeason - assortment - publishToFlexPLM=true', () => {
102
+ const newData = {
103
+ entityType: 'assortment',
104
+ flex2vibeMapKeyRoot: 'LCSSeason'
105
+ };
106
+
107
+ const objectClass = TypeDefaults.getDefaultObjectClass(newData);
108
+
109
+ expect(objectClass).toEqual('LCSSeason');
110
+ });
111
+ });
112
+
113
+ describe('getDefaultObjectTypePath', () =>{
114
+ it('item-family', () =>{
115
+ const newData = {
116
+ entityType: 'item',
117
+ roles: ['family']
118
+ };
119
+
120
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
121
+ expect(typePath).toEqual('Product');
122
+ });
123
+
124
+ it('item-color', () =>{
125
+ const newData = {
126
+ entityType: 'item',
127
+ roles: ['color']
128
+ };
129
+
130
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
131
+ expect(typePath).toEqual('Product');
132
+ });
133
+
134
+ it('project-item-family', () =>{
135
+ const newData = {
136
+ entityType: 'project-item',
137
+ roles: ['family']
138
+ };
139
+
140
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
141
+ expect(typePath).toEqual('Product');
142
+ });
143
+
144
+ it('project-item-color', () =>{
145
+ const newData = {
146
+ entityType: 'project-item',
147
+ roles: ['color']
148
+ };
149
+
150
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
151
+ expect(typePath).toEqual('Product');
152
+ });
153
+
154
+ it('color', () =>{
155
+ const newData = {
156
+ entityType: 'color'
157
+ };
158
+
159
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
160
+ expect(typePath).toEqual('Color');
161
+ });
162
+
163
+ it('custom-entity', () =>{
164
+ const newData = {
165
+ entityType: 'custom-entity'
166
+ };
167
+
168
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
169
+ expect(typePath).toEqual('Revisable Entity');
170
+ });
171
+
172
+ it('project', () =>{
173
+ const newData = {
174
+ entityType: 'project'
175
+ };
176
+
177
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
178
+ expect(typePath).toEqual('Season');
179
+ });
180
+
181
+ it('assortment', () =>{
182
+ const newData = {
183
+ entityType: 'assortment'
184
+ };
185
+
186
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
187
+ expect(typePath).toEqual('Season Group');
188
+ });
189
+
190
+ it('assortment - publishToFlexPLM=true', () =>{
191
+ const newData = {
192
+ entityType: 'assortment',
193
+ publishToFlexPLM: true
194
+ };
195
+
196
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
197
+ expect(typePath).toEqual('Season');
198
+ });
199
+
200
+ it('assortment - flex2vibeMapKeyRoot=LCSSeason', () =>{
201
+ const newData = {
202
+ entityType: 'assortment',
203
+ flex2vibeMapKeyRoot: 'LCSSeason'
204
+ };
205
+
206
+ const typePath = TypeDefaults.getDefaultObjectTypePath(newData);
207
+ expect(typePath).toEqual('Season');
208
+ });
209
+ });
210
+
211
+ describe('getDefaultIdentifiers', () =>{
212
+ it('item-family', () =>{
213
+ const newData = {
214
+ entityType: 'item',
215
+ roles: ['family']
216
+ };
217
+
218
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
219
+ expect(defaultIdentifiers).toContain('itemNumber');
220
+ expect(defaultIdentifiers).toHaveLength(1);
221
+ });
222
+
223
+ it('item-color', () =>{
224
+ const newData = {
225
+ entityType: 'item',
226
+ roles: ['color']
227
+ };
228
+
229
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
230
+ expect(defaultIdentifiers).toContain('itemNumber');
231
+ expect(defaultIdentifiers).toHaveLength(1);
232
+ });
233
+
234
+ it('project', () =>{
235
+ const newData = {
236
+ entityType: 'project'
237
+ };
238
+
239
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
240
+ expect(defaultIdentifiers).toContain('flexPLMSeasonName');
241
+ expect(defaultIdentifiers).toHaveLength(1);
242
+ });
243
+
244
+ it('assortment', () =>{
245
+ const newData = {
246
+ entityType: 'assortment'
247
+ };
248
+
249
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
250
+ expect(defaultIdentifiers).toContain('seasonGroupName');
251
+ expect(defaultIdentifiers).toHaveLength(1);
252
+ });
253
+
254
+ it('assortment - publishToFlexPLM=true', () =>{
255
+ const newData = {
256
+ entityType: 'assortment',
257
+ publishToFlexPLM: true
258
+ };
259
+
260
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
261
+ expect(defaultIdentifiers).toContain('flexPLMSeasonName');
262
+ expect(defaultIdentifiers).toHaveLength(1);
263
+ });
264
+
265
+ it('assortment - flex2vibeMapKeyRoot=LCSSeason', () =>{
266
+ const newData = {
267
+ entityType: 'assortment',
268
+ flex2vibeMapKeyRoot: 'LCSSeason'
269
+ };
270
+
271
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
272
+ expect(defaultIdentifiers).toContain('flexPLMSeasonName');
273
+ expect(defaultIdentifiers).toHaveLength(1);
274
+ });
275
+
276
+ it('color', () =>{
277
+ const newData = {
278
+ entityType: 'color'
279
+ };
280
+
281
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
282
+ expect(defaultIdentifiers).toContain('name');
283
+ expect(defaultIdentifiers).toHaveLength(1);
284
+ });
285
+
286
+ it('custom-entity', () =>{
287
+
288
+ const newData = {
289
+ entityType: 'custom-entity'
290
+ };
291
+
292
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierProperties(newData);
293
+ expect(defaultIdentifiers).toContain('name');
294
+ expect(defaultIdentifiers).toHaveLength(1);
295
+ });
296
+ });
297
+
298
+ describe('getDefaultInformationalProperties', () =>{
299
+ it('item-family', () =>{
300
+ const newData = {
301
+ entityType: 'item',
302
+ roles: ['family']
303
+ };
304
+
305
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
306
+ expect(defaultIdentifiers).toContain('name');
307
+ expect(defaultIdentifiers).toHaveLength(1);
308
+ });
309
+
310
+ it('item-color', () =>{
311
+ const newData = {
312
+ entityType: 'item',
313
+ roles: ['color']
314
+ };
315
+
316
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
317
+ expect(defaultIdentifiers).toContain('optionName');
318
+ expect(defaultIdentifiers).toHaveLength(1);
319
+ });
320
+
321
+ it('project', () =>{
322
+ const newData = {
323
+ entityType: 'project'
324
+ };
325
+
326
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
327
+ expect(defaultIdentifiers).toContain('name');
328
+ expect(defaultIdentifiers).toHaveLength(1);
329
+ });
330
+
331
+ it('assortment', () =>{
332
+ const newData = {
333
+ entityType: 'assortment'
334
+ };
335
+
336
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
337
+ expect(defaultIdentifiers).toContain('name');
338
+ expect(defaultIdentifiers).toHaveLength(1);
339
+ });
340
+
341
+
342
+ it('color', () =>{
343
+ const newData = {
344
+ entityType: 'color'
345
+ };
346
+
347
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
348
+ expect(defaultIdentifiers).toHaveLength(0);
349
+ });
350
+
351
+ it('custom-entity', () =>{
352
+
353
+ const newData = {
354
+ entityType: 'custom-entity'
355
+ };
356
+
357
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalProperties(newData);
358
+ expect(defaultIdentifiers).toHaveLength(0);
359
+ });
360
+ });
361
+
362
+ describe('getEntityType', () =>{
363
+ it('entityType', () =>{
364
+ const entityType = 'item';
365
+ const entity = {
366
+ entityType
367
+ };
368
+
369
+ const results = TypeDefaults.getEntityType(entity);
370
+ expect(results).toEqual(entityType);
371
+ });
372
+
373
+ it('entityType from type path', () =>{
374
+ const entityType = 'item';
375
+ const typePath = 'item:product:apparel';
376
+ const entity = {
377
+ typePath: typePath
378
+ };
379
+
380
+ const results = TypeDefaults.getEntityType(entity);
381
+ expect(results).toEqual(entityType);
382
+ });
383
+
384
+ it('No entityType', () =>{
385
+ const typePath = 'item:product:apparel';
386
+ const entity = {
387
+ someValue: typePath
388
+ };
389
+
390
+ expect(() =>TypeDefaults.getEntityType(entity)).toThrowError();
391
+ expect(() =>TypeDefaults.getEntityType(entity)).toThrow(TypeDefaults.NO_ENTITY_TYPE);
392
+
393
+ });
394
+
395
+ });//getEntityType
396
+
397
+ describe('getDefaultEntityClass', () =>{
398
+ it('item - LCSProduct', () =>{
399
+ const object = {
400
+ flexPLMObjectClass: 'LCSProduct'
401
+ };
402
+
403
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
404
+
405
+ expect(entityClass).toBe('item');
406
+ });
407
+
408
+ it('item - LCSSKU', () =>{
409
+ const object = {
410
+ flexPLMObjectClass: 'LCSSKU'
411
+ };
412
+
413
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
414
+
415
+ expect(entityClass).toBe('item');
416
+ });
417
+
418
+ it('project-item - LCSProductSeasonLink', () =>{
419
+ const object = {
420
+ flexPLMObjectClass: 'LCSProductSeasonLink'
421
+ };
422
+
423
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
424
+
425
+ expect(entityClass).toBe('project-item');
426
+ });
427
+
428
+ it('project-item - LCSSKUSeasonLink', () =>{
429
+ const object = {
430
+ flexPLMObjectClass: 'LCSSKUSeasonLink'
431
+ };
432
+
433
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
434
+
435
+ expect(entityClass).toBe('project-item');
436
+ });
437
+
438
+ it('color - LCSColor', () =>{
439
+ const object = {
440
+ flexPLMObjectClass: 'LCSColor'
441
+ };
442
+
443
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
444
+
445
+ expect(entityClass).toBe('color');
446
+ });
447
+
448
+ it('assortment - LCSSeason', () =>{
449
+ const object = {
450
+ flexPLMObjectClass: 'LCSSeason'
451
+ };
452
+
453
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
454
+
455
+ expect(entityClass).toBe('assortment');
456
+ });
457
+
458
+ it('assortment - SeasonGroup', () =>{
459
+ const object = {
460
+ flexPLMObjectClass: 'SeasonGroup'
461
+ };
462
+
463
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
464
+
465
+ expect(entityClass).toBe('assortment');
466
+ });
467
+
468
+ it('custom-entity - LCSRevisableEntity', () =>{
469
+ const object = {
470
+ flexPLMObjectClass: 'LCSRevisableEntity'
471
+ };
472
+
473
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
474
+
475
+ expect(entityClass).toBe('custom-entity');
476
+ });
477
+
478
+ it('custom-entity - LCSLifecycleManaged', () =>{
479
+ const object = {
480
+ flexPLMObjectClass: 'LCSLifecycleManaged'
481
+ };
482
+
483
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
484
+
485
+ expect(entityClass).toBe('custom-entity');
486
+ });
487
+
488
+ });//getDefaultEntityClass
489
+
490
+ describe('getDefaultEntityTypePath', () =>{
491
+ it('LCSProduct', () =>{
492
+ const object = {
493
+ flexPLMObjectClass: 'LCSProduct'
494
+ };
495
+
496
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
497
+ expect(typePath).toBe('item');
498
+ });
499
+
500
+ it('LCSSKU', () =>{
501
+ const object = {
502
+ flexPLMObjectClass: 'LCSSKU'
503
+ };
504
+
505
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
506
+ expect(typePath).toBe('item');
507
+ });
508
+ it('LCSProductSeasonLink', () =>{
509
+ const object = {
510
+ flexPLMObjectClass: 'LCSProductSeasonLink'
511
+ };
512
+
513
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
514
+ expect(typePath).toBe('project-item');
515
+ });
516
+
517
+ it('LCSSKUSeasonLink', () =>{
518
+ const object = {
519
+ flexPLMObjectClass: 'LCSSKUSeasonLink'
520
+ };
521
+
522
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
523
+ expect(typePath).toBe('project-item');
524
+ });
525
+
526
+ it('LCSColor', () =>{
527
+ const object = {
528
+ flexPLMObjectClass: 'LCSColor'
529
+ };
530
+
531
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
532
+ expect(typePath).toBe('color');
533
+ });
534
+
535
+ it('LCSSeason', () =>{
536
+ const object = {
537
+ flexPLMObjectClass: 'LCSSeason'
538
+ };
539
+
540
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
541
+ expect(typePath).toBe('assortment');
542
+ });
543
+
544
+ it('SeasonGroup', () =>{
545
+ const object = {
546
+ flexPLMObjectClass: 'SeasonGroup'
547
+ };
548
+
549
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
550
+ expect(typePath).toBe('assortment');
551
+ });
552
+ });//getDefaultEntityTypePath
553
+
554
+ describe('getDefaultIdentifierPropertiesFromObject', () =>{
555
+ it('LCSProduct', () =>{
556
+ const object = {
557
+ flexPLMObjectClass: 'LCSProduct'
558
+ };
559
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
560
+
561
+ expect(defaultIdentifiers).toContain('itemNumber');
562
+ expect(defaultIdentifiers).toHaveLength(1);
563
+ });
564
+
565
+ it('LCSSKU', () =>{
566
+ const object = {
567
+ flexPLMObjectClass: 'LCSSKU'
568
+ };
569
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
570
+
571
+ expect(defaultIdentifiers).toContain('itemNumber');
572
+ expect(defaultIdentifiers).toHaveLength(1);
573
+ });
574
+
575
+ it('LCSSeason', () =>{
576
+ const object = {
577
+ flexPLMObjectClass: 'LCSSeason'
578
+ };
579
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
580
+
581
+ expect(defaultIdentifiers).toContain('flexPLMSeasonName');
582
+ expect(defaultIdentifiers).toHaveLength(1);
583
+ });
584
+
585
+ it('SeasonGroup', () =>{
586
+ const object = {
587
+ flexPLMObjectClass: 'SeasonGroup'
588
+ };
589
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
590
+
591
+ expect(defaultIdentifiers).toContain('seasonGroupName');
592
+ expect(defaultIdentifiers).toHaveLength(1);
593
+ });
594
+
595
+ it('LCSColor', () =>{
596
+ const object = {
597
+ flexPLMObjectClass: 'LCSColor'
598
+ };
599
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
600
+
601
+ expect(defaultIdentifiers).toContain('name');
602
+ expect(defaultIdentifiers).toHaveLength(1);
603
+ });
604
+
605
+ it('LCSRevisableEntity', () =>{
606
+ const object = {
607
+ flexPLMObjectClass: 'LCSRevisableEntity'
608
+ };
609
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
610
+
611
+ expect(defaultIdentifiers).toContain('name');
612
+ expect(defaultIdentifiers).toHaveLength(1);
613
+ });
614
+
615
+ it('LCSLifecycleManaged', () =>{
616
+ const object = {
617
+ flexPLMObjectClass: 'LCSLifecycleManaged'
618
+ };
619
+ const defaultIdentifiers = TypeDefaults.getDefaultIdentifierPropertiesFromObject(object);
620
+
621
+ expect(defaultIdentifiers).toContain('name');
622
+ expect(defaultIdentifiers).toHaveLength(1);
623
+ });
624
+
625
+ });//getDefaultIdentifierPropertiesFromObject
626
+
627
+ describe('getDefaultInformationalPropertiesFromObject', () =>{
628
+ it('LCSProduct', () =>{
629
+ const object = {
630
+ flexPLMObjectClass: 'LCSProduct'
631
+ };
632
+
633
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
634
+ expect(defaultIdentifiers).toContain('name');
635
+ expect(defaultIdentifiers).toHaveLength(1);
636
+ });
637
+
638
+ it('LCSSKU', () =>{
639
+ const object = {
640
+ flexPLMObjectClass: 'LCSSKU'
641
+ };
642
+
643
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
644
+ expect(defaultIdentifiers).toContain('optionName');
645
+ expect(defaultIdentifiers).toHaveLength(1);
646
+ });
647
+
648
+ it('LCSSeason', () =>{
649
+ const object = {
650
+ flexPLMObjectClass: 'LCSSeason'
651
+ };
652
+
653
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
654
+ expect(defaultIdentifiers).toContain('name');
655
+ expect(defaultIdentifiers).toHaveLength(1);
656
+ });
657
+
658
+ it('SeasonGroup', () =>{
659
+ const object = {
660
+ flexPLMObjectClass: 'SeasonGroup'
661
+ };
662
+
663
+ const defaultIdentifiers = TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
664
+ expect(defaultIdentifiers).toContain('name');
665
+ expect(defaultIdentifiers).toHaveLength(1);
666
+ });
667
+
668
+ });//getDefaultInformationalPropertiesFromObject
669
669
  });