@contrail/flexplm 1.3.0-alpha.0 → 1.3.0-alpha.4
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/.claude/settings.local.json +2 -1
- package/.github/pull_request_template.md +31 -31
- package/.github/workflows/flexplm-lib.yml +27 -27
- package/CHANGELOG.md +1 -1
- package/lib/entity-processor/base-entity-processor.d.ts +42 -0
- package/lib/entity-processor/base-entity-processor.js +377 -0
- package/lib/entity-processor/base-entity-processor.spec.d.ts +1 -0
- package/lib/entity-processor/base-entity-processor.spec.js +426 -0
- package/lib/flexplm-request.d.ts +3 -0
- package/lib/flexplm-request.js +34 -0
- package/lib/flexplm-utils.d.ts +5 -0
- package/lib/flexplm-utils.js +33 -0
- package/lib/flexplm-utils.spec.d.ts +1 -0
- package/lib/flexplm-utils.spec.js +26 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.js +38 -0
- package/lib/interfaces/interfaces.d.ts +105 -0
- package/lib/interfaces/interfaces.js +2 -0
- package/lib/interfaces/item-family-changes.d.ts +20 -0
- package/lib/interfaces/item-family-changes.js +56 -0
- package/lib/interfaces/publish-change-data.d.ts +19 -0
- package/lib/interfaces/publish-change-data.js +32 -0
- package/lib/publish/base-process-publish-assortment-callback.d.ts +9 -0
- package/lib/publish/base-process-publish-assortment-callback.js +38 -0
- package/lib/publish/base-process-publish-assortment.d.ts +93 -0
- package/lib/publish/base-process-publish-assortment.js +944 -0
- package/lib/publish/base-process-publish-assortment.spec.d.ts +1 -0
- package/lib/publish/base-process-publish-assortment.spec.js +1670 -0
- package/lib/publish/mockData.d.ts +1389 -0
- package/lib/publish/mockData.js +4519 -0
- package/lib/transform/identifier-conversion-spec-mockData.d.ts +0 -0
- package/lib/transform/identifier-conversion-spec-mockData.js +444 -0
- package/lib/transform/identifier-conversion.d.ts +15 -0
- package/lib/transform/identifier-conversion.js +212 -0
- package/lib/transform/identifier-conversion.spec.d.ts +1 -0
- package/lib/transform/identifier-conversion.spec.js +339 -0
- package/lib/util/config-defaults.d.ts +8 -0
- package/lib/util/config-defaults.js +85 -0
- package/lib/util/config-defaults.spec.d.ts +1 -0
- package/lib/util/config-defaults.spec.js +293 -0
- package/lib/util/data-converter-spec-mockData.d.ts +0 -0
- package/lib/util/data-converter-spec-mockData.js +205 -0
- package/lib/util/data-converter.d.ts +39 -0
- package/lib/util/data-converter.js +592 -0
- package/lib/util/data-converter.spec.d.ts +1 -0
- package/lib/util/data-converter.spec.js +904 -0
- package/lib/util/error-response-object.d.ts +4 -0
- package/lib/util/error-response-object.js +47 -0
- package/lib/util/error-response-object.spec.d.ts +1 -0
- package/lib/util/error-response-object.spec.js +99 -0
- package/lib/util/event-short-message-status.d.ts +18 -0
- package/lib/util/event-short-message-status.js +22 -0
- package/lib/util/federation.d.ts +15 -0
- package/lib/util/federation.js +149 -0
- package/lib/util/flexplm-connect.d.ts +22 -0
- package/lib/util/flexplm-connect.js +176 -0
- package/lib/util/flexplm-connect.spec.d.ts +1 -0
- package/lib/util/flexplm-connect.spec.js +88 -0
- package/lib/util/logger-config.d.ts +1 -0
- package/lib/util/logger-config.js +26 -0
- package/lib/util/map-util-spec-mockData.d.ts +0 -0
- package/lib/util/map-util-spec-mockData.js +205 -0
- package/lib/util/map-utils.d.ts +6 -0
- package/lib/util/map-utils.js +15 -0
- package/lib/util/map-utils.spec.d.ts +1 -0
- package/lib/util/map-utils.spec.js +89 -0
- package/lib/util/mockData.d.ts +80 -0
- package/lib/util/mockData.js +103 -0
- package/lib/util/thumbnail-util.d.ts +34 -0
- package/lib/util/thumbnail-util.js +211 -0
- package/lib/util/thumbnail-util.spec.d.ts +1 -0
- package/lib/util/thumbnail-util.spec.js +398 -0
- package/lib/util/type-conversion-utils-spec-mockData.d.ts +0 -0
- package/lib/util/type-conversion-utils-spec-mockData.js +259 -0
- package/lib/util/type-conversion-utils.d.ts +23 -0
- package/lib/util/type-conversion-utils.js +266 -0
- package/lib/util/type-conversion-utils.spec.d.ts +1 -0
- package/lib/util/type-conversion-utils.spec.js +868 -0
- package/lib/util/type-defaults.d.ts +16 -0
- package/lib/util/type-defaults.js +221 -0
- package/lib/util/type-defaults.spec.d.ts +1 -0
- package/lib/util/type-defaults.spec.js +516 -0
- package/lib/util/type-utils.d.ts +13 -0
- package/lib/util/type-utils.js +114 -0
- package/lib/util/type-utils.spec.d.ts +1 -0
- package/lib/util/type-utils.spec.js +190 -0
- package/package.json +1 -1
- package/publish.bat +4 -4
- package/publish.sh +4 -4
- package/src/entity-processor/base-entity-processor.spec.ts +157 -0
- package/src/entity-processor/base-entity-processor.ts +21 -2
- package/src/flexplm-request.ts +28 -28
- package/src/flexplm-utils.spec.ts +27 -27
- package/src/flexplm-utils.ts +29 -29
- package/src/index.ts +21 -21
- package/src/interfaces/item-family-changes.ts +66 -66
- package/src/interfaces/publish-change-data.ts +42 -42
- package/src/publish/base-process-publish-assortment-callback.ts +50 -50
- package/src/transform/identifier-conversion-spec-mockData.ts +495 -495
- package/src/transform/identifier-conversion.spec.ts +353 -353
- package/src/transform/identifier-conversion.ts +281 -281
- package/src/util/config-defaults.spec.ts +350 -350
- package/src/util/config-defaults.ts +92 -92
- package/src/util/data-converter-spec-mockData.ts +230 -230
- package/src/util/error-response-object.spec.ts +115 -115
- package/src/util/error-response-object.ts +49 -49
- package/src/util/federation.ts +172 -172
- package/src/util/logger-config.ts +19 -19
- package/src/util/map-util-spec-mockData.ts +230 -230
- package/src/util/map-utils.spec.ts +102 -102
- package/src/util/map-utils.ts +40 -40
- package/src/util/mockData.ts +101 -97
- package/src/util/thumbnail-util.spec.ts +190 -0
- package/src/util/thumbnail-util.ts +126 -5
- package/src/util/type-conversion-utils.spec.ts +25 -25
- package/src/util/type-conversion-utils.ts +10 -9
- package/src/util/type-defaults.spec.ts +668 -668
- package/src/util/type-defaults.ts +280 -280
- package/src/util/type-utils.spec.ts +227 -227
- package/src/util/type-utils.ts +144 -144
- package/tsconfig.json +28 -26
- package/tslint.json +57 -57
- package/scripts/output.png +0 -0
- package/scripts/test-get-request.ts +0 -35
|
@@ -1,227 +1,227 @@
|
|
|
1
|
-
import { TypeUtils } from './type-utils';
|
|
2
|
-
|
|
3
|
-
describe('TypeUtils.getEventObjectClass() tests', () =>{
|
|
4
|
-
|
|
5
|
-
const tu = new TypeUtils();
|
|
6
|
-
|
|
7
|
-
it('LCSProduct', () =>{
|
|
8
|
-
const entityType = 'item';
|
|
9
|
-
const newData = {
|
|
10
|
-
roles: ['family']
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
14
|
-
|
|
15
|
-
expect(objectClass).toEqual('LCSProduct');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('LCSSKU', () =>{
|
|
19
|
-
const entityType = 'item';
|
|
20
|
-
const newData = {
|
|
21
|
-
roles: ['color']
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
25
|
-
|
|
26
|
-
expect(objectClass).toEqual('LCSSKU');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('LCSProductSeasonLink', () =>{
|
|
30
|
-
const entityType = 'project-item';
|
|
31
|
-
const newData = {
|
|
32
|
-
roles: ['family']
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
36
|
-
|
|
37
|
-
expect(objectClass).toEqual('LCSProductSeasonLink');
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('LCSSKUSeasonLink', () =>{
|
|
41
|
-
const entityType = 'project-item';
|
|
42
|
-
const newData = {
|
|
43
|
-
roles: ['color']
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
47
|
-
|
|
48
|
-
expect(objectClass).toEqual('LCSSKUSeasonLink');
|
|
49
|
-
});
|
|
50
|
-
it('LCSColor', () =>{
|
|
51
|
-
const entityType = 'color';
|
|
52
|
-
const newData = {};
|
|
53
|
-
|
|
54
|
-
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
55
|
-
|
|
56
|
-
expect(objectClass).toEqual('LCSColor');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('LCSRevisableEntity', () =>{
|
|
60
|
-
const entityType = 'custom-entity';
|
|
61
|
-
const newData = {};
|
|
62
|
-
|
|
63
|
-
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
64
|
-
|
|
65
|
-
expect(objectClass).toEqual('LCSRevisableEntity');
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
describe('filterProperties-item', () => {
|
|
70
|
-
|
|
71
|
-
const itemType = {
|
|
72
|
-
typePath: 'item'
|
|
73
|
-
};
|
|
74
|
-
itemType['typeProperties'] = [
|
|
75
|
-
{
|
|
76
|
-
id: 'H4NazLloHdUVhc71',
|
|
77
|
-
slug: 'null',
|
|
78
|
-
propertyLevel: null
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
id: 'H4NazLloHdUVhc71',
|
|
82
|
-
slug: 'family',
|
|
83
|
-
propertyLevel: 'family'
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: 'H4NazLloHdUVhc71',
|
|
87
|
-
slug: 'option',
|
|
88
|
-
propertyLevel: 'option'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: 'H4NazLloHdUVhc71',
|
|
92
|
-
slug: 'overridable',
|
|
93
|
-
propertyLevel: 'overridable'
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: 'H4NazLloHdUVhc71',
|
|
97
|
-
slug: 'all',
|
|
98
|
-
propertyLevel: 'all'
|
|
99
|
-
},
|
|
100
|
-
];
|
|
101
|
-
const tu = new TypeUtils();
|
|
102
|
-
|
|
103
|
-
it('item-family', () =>{
|
|
104
|
-
const len = 4;
|
|
105
|
-
const newData = {
|
|
106
|
-
roles: ['family']
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const filteredProps = tu.filterTypeProperties(itemType, newData);
|
|
110
|
-
expect(filteredProps.length).toEqual(len);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it('item-option', () =>{
|
|
114
|
-
const len = 4;
|
|
115
|
-
const newData = {
|
|
116
|
-
roles: ['option']
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const filteredProps = tu.filterTypeProperties(itemType, newData);
|
|
120
|
-
expect(filteredProps.length).toEqual(len);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it('item-no-roles', () =>{
|
|
124
|
-
const len = 5;
|
|
125
|
-
const newData = {
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const filteredProps = tu.filterTypeProperties(itemType, newData);
|
|
129
|
-
expect(filteredProps.length).toEqual(len);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
//project-item
|
|
134
|
-
describe('filterProperties-project-item', () => {
|
|
135
|
-
|
|
136
|
-
const projectItemType = {
|
|
137
|
-
typePath: 'project-item'
|
|
138
|
-
};
|
|
139
|
-
projectItemType['typeProperties'] = [
|
|
140
|
-
{
|
|
141
|
-
id: 'H4NazLloHdUVhc71',
|
|
142
|
-
slug: 'null',
|
|
143
|
-
propertyLevel: null
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
id: 'H4NazLloHdUVhc71',
|
|
147
|
-
slug: 'family',
|
|
148
|
-
propertyLevel: 'family'
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
id: 'H4NazLloHdUVhc71',
|
|
152
|
-
slug: 'option',
|
|
153
|
-
propertyLevel: 'option'
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: 'H4NazLloHdUVhc71',
|
|
157
|
-
slug: 'overridable',
|
|
158
|
-
propertyLevel: 'overridable'
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
id: 'H4NazLloHdUVhc71',
|
|
162
|
-
slug: 'all',
|
|
163
|
-
propertyLevel: 'all'
|
|
164
|
-
},
|
|
165
|
-
];
|
|
166
|
-
const tu = new TypeUtils();
|
|
167
|
-
|
|
168
|
-
it('item-family', () =>{
|
|
169
|
-
const len = 4;
|
|
170
|
-
const newData = {
|
|
171
|
-
roles: ['family']
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
const filteredProps = tu.filterTypeProperties(projectItemType, newData);
|
|
175
|
-
expect(filteredProps.length).toEqual(len);
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
it('item-option', () =>{
|
|
179
|
-
const len = 4;
|
|
180
|
-
const newData = {
|
|
181
|
-
roles: ['option']
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
const filteredProps = tu.filterTypeProperties(projectItemType, newData);
|
|
185
|
-
expect(filteredProps.length).toEqual(len);
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
//color
|
|
190
|
-
describe('filterProperties-color', () => {
|
|
191
|
-
const colorType = {
|
|
192
|
-
typePath: 'color'
|
|
193
|
-
};
|
|
194
|
-
colorType['typeProperties'] = [
|
|
195
|
-
{
|
|
196
|
-
id: 'H4NazLloHdUVhc71',
|
|
197
|
-
slug: 'null',
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
id: 'H4NazLloHdUVhc71',
|
|
201
|
-
slug: 'family',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
id: 'H4NazLloHdUVhc71',
|
|
205
|
-
slug: 'option',
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
id: 'H4NazLloHdUVhc71',
|
|
209
|
-
slug: 'overridable',
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
id: 'H4NazLloHdUVhc71',
|
|
213
|
-
slug: 'all',
|
|
214
|
-
},
|
|
215
|
-
];
|
|
216
|
-
const tu = new TypeUtils();
|
|
217
|
-
|
|
218
|
-
it('color', () =>{
|
|
219
|
-
const len = 5;
|
|
220
|
-
const newData = {
|
|
221
|
-
roles: ['family']
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
const filteredProps = tu.filterTypeProperties(colorType, newData);
|
|
225
|
-
expect(filteredProps.length).toEqual(len);
|
|
226
|
-
});
|
|
227
|
-
});
|
|
1
|
+
import { TypeUtils } from './type-utils';
|
|
2
|
+
|
|
3
|
+
describe('TypeUtils.getEventObjectClass() tests', () =>{
|
|
4
|
+
|
|
5
|
+
const tu = new TypeUtils();
|
|
6
|
+
|
|
7
|
+
it('LCSProduct', () =>{
|
|
8
|
+
const entityType = 'item';
|
|
9
|
+
const newData = {
|
|
10
|
+
roles: ['family']
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
14
|
+
|
|
15
|
+
expect(objectClass).toEqual('LCSProduct');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('LCSSKU', () =>{
|
|
19
|
+
const entityType = 'item';
|
|
20
|
+
const newData = {
|
|
21
|
+
roles: ['color']
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
25
|
+
|
|
26
|
+
expect(objectClass).toEqual('LCSSKU');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('LCSProductSeasonLink', () =>{
|
|
30
|
+
const entityType = 'project-item';
|
|
31
|
+
const newData = {
|
|
32
|
+
roles: ['family']
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
36
|
+
|
|
37
|
+
expect(objectClass).toEqual('LCSProductSeasonLink');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('LCSSKUSeasonLink', () =>{
|
|
41
|
+
const entityType = 'project-item';
|
|
42
|
+
const newData = {
|
|
43
|
+
roles: ['color']
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
47
|
+
|
|
48
|
+
expect(objectClass).toEqual('LCSSKUSeasonLink');
|
|
49
|
+
});
|
|
50
|
+
it('LCSColor', () =>{
|
|
51
|
+
const entityType = 'color';
|
|
52
|
+
const newData = {};
|
|
53
|
+
|
|
54
|
+
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
55
|
+
|
|
56
|
+
expect(objectClass).toEqual('LCSColor');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('LCSRevisableEntity', () =>{
|
|
60
|
+
const entityType = 'custom-entity';
|
|
61
|
+
const newData = {};
|
|
62
|
+
|
|
63
|
+
const objectClass = tu.getEventObjectClass(entityType, newData);
|
|
64
|
+
|
|
65
|
+
expect(objectClass).toEqual('LCSRevisableEntity');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
});
|
|
69
|
+
describe('filterProperties-item', () => {
|
|
70
|
+
|
|
71
|
+
const itemType = {
|
|
72
|
+
typePath: 'item'
|
|
73
|
+
};
|
|
74
|
+
itemType['typeProperties'] = [
|
|
75
|
+
{
|
|
76
|
+
id: 'H4NazLloHdUVhc71',
|
|
77
|
+
slug: 'null',
|
|
78
|
+
propertyLevel: null
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'H4NazLloHdUVhc71',
|
|
82
|
+
slug: 'family',
|
|
83
|
+
propertyLevel: 'family'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'H4NazLloHdUVhc71',
|
|
87
|
+
slug: 'option',
|
|
88
|
+
propertyLevel: 'option'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'H4NazLloHdUVhc71',
|
|
92
|
+
slug: 'overridable',
|
|
93
|
+
propertyLevel: 'overridable'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'H4NazLloHdUVhc71',
|
|
97
|
+
slug: 'all',
|
|
98
|
+
propertyLevel: 'all'
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
const tu = new TypeUtils();
|
|
102
|
+
|
|
103
|
+
it('item-family', () =>{
|
|
104
|
+
const len = 4;
|
|
105
|
+
const newData = {
|
|
106
|
+
roles: ['family']
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const filteredProps = tu.filterTypeProperties(itemType, newData);
|
|
110
|
+
expect(filteredProps.length).toEqual(len);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('item-option', () =>{
|
|
114
|
+
const len = 4;
|
|
115
|
+
const newData = {
|
|
116
|
+
roles: ['option']
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const filteredProps = tu.filterTypeProperties(itemType, newData);
|
|
120
|
+
expect(filteredProps.length).toEqual(len);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('item-no-roles', () =>{
|
|
124
|
+
const len = 5;
|
|
125
|
+
const newData = {
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const filteredProps = tu.filterTypeProperties(itemType, newData);
|
|
129
|
+
expect(filteredProps.length).toEqual(len);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
//project-item
|
|
134
|
+
describe('filterProperties-project-item', () => {
|
|
135
|
+
|
|
136
|
+
const projectItemType = {
|
|
137
|
+
typePath: 'project-item'
|
|
138
|
+
};
|
|
139
|
+
projectItemType['typeProperties'] = [
|
|
140
|
+
{
|
|
141
|
+
id: 'H4NazLloHdUVhc71',
|
|
142
|
+
slug: 'null',
|
|
143
|
+
propertyLevel: null
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 'H4NazLloHdUVhc71',
|
|
147
|
+
slug: 'family',
|
|
148
|
+
propertyLevel: 'family'
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'H4NazLloHdUVhc71',
|
|
152
|
+
slug: 'option',
|
|
153
|
+
propertyLevel: 'option'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 'H4NazLloHdUVhc71',
|
|
157
|
+
slug: 'overridable',
|
|
158
|
+
propertyLevel: 'overridable'
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'H4NazLloHdUVhc71',
|
|
162
|
+
slug: 'all',
|
|
163
|
+
propertyLevel: 'all'
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
const tu = new TypeUtils();
|
|
167
|
+
|
|
168
|
+
it('item-family', () =>{
|
|
169
|
+
const len = 4;
|
|
170
|
+
const newData = {
|
|
171
|
+
roles: ['family']
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const filteredProps = tu.filterTypeProperties(projectItemType, newData);
|
|
175
|
+
expect(filteredProps.length).toEqual(len);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
it('item-option', () =>{
|
|
179
|
+
const len = 4;
|
|
180
|
+
const newData = {
|
|
181
|
+
roles: ['option']
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const filteredProps = tu.filterTypeProperties(projectItemType, newData);
|
|
185
|
+
expect(filteredProps.length).toEqual(len);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
//color
|
|
190
|
+
describe('filterProperties-color', () => {
|
|
191
|
+
const colorType = {
|
|
192
|
+
typePath: 'color'
|
|
193
|
+
};
|
|
194
|
+
colorType['typeProperties'] = [
|
|
195
|
+
{
|
|
196
|
+
id: 'H4NazLloHdUVhc71',
|
|
197
|
+
slug: 'null',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: 'H4NazLloHdUVhc71',
|
|
201
|
+
slug: 'family',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: 'H4NazLloHdUVhc71',
|
|
205
|
+
slug: 'option',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: 'H4NazLloHdUVhc71',
|
|
209
|
+
slug: 'overridable',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: 'H4NazLloHdUVhc71',
|
|
213
|
+
slug: 'all',
|
|
214
|
+
},
|
|
215
|
+
];
|
|
216
|
+
const tu = new TypeUtils();
|
|
217
|
+
|
|
218
|
+
it('color', () =>{
|
|
219
|
+
const len = 5;
|
|
220
|
+
const newData = {
|
|
221
|
+
roles: ['family']
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const filteredProps = tu.filterTypeProperties(colorType, newData);
|
|
225
|
+
expect(filteredProps.length).toEqual(len);
|
|
226
|
+
});
|
|
227
|
+
});
|