@@ -11,6 +11,7 @@ import {
11
11
FrequentLicenses ,
12
12
PackageInfo ,
13
13
ParsedFileContent ,
14
+ ProjectConfig ,
14
15
Resources ,
15
16
ResourcesToAttributions ,
16
17
} from '../../../../../shared/shared-types' ;
@@ -20,6 +21,7 @@ import { initialResourceState } from '../../../reducers/resource-reducer';
20
21
import {
21
22
getAttributionBreakpoints ,
22
23
getBaseUrlsForSources ,
24
+ getClassifications ,
23
25
getExternalAttributionSources ,
24
26
getExternalData ,
25
27
getFilesWithChildren ,
@@ -45,6 +47,13 @@ const testResources: Resources = {
45
47
} ,
46
48
} ;
47
49
50
+ const testConfig : ProjectConfig = {
51
+ classifications : {
52
+ 0 : 'UNKNOWN' ,
53
+ 1 : 'CRITICAL' ,
54
+ } ,
55
+ } ;
56
+
48
57
const testManualAttributionUuid_1 = '4d9f0b16-fbff-11ea-adc1-0242ac120002' ;
49
58
const testManualAttributionUuid_2 = 'b5da73d4-f400-11ea-adc1-0242ac120002' ;
50
59
const testTemporaryDisplayPackageInfo : PackageInfo = {
@@ -129,6 +138,7 @@ describe('loadFromFile', () => {
129
138
const testParsedFileContent : ParsedFileContent = {
130
139
metadata : EMPTY_PROJECT_METADATA ,
131
140
resources : testResources ,
141
+ config : testConfig ,
132
142
manualAttributions : {
133
143
attributions : testManualAttributions ,
134
144
resourcesToAttributions : testResourcesToManualAttributions ,
@@ -149,6 +159,7 @@ describe('loadFromFile', () => {
149
159
} ,
150
160
} ;
151
161
const expectedResources : Resources = testResources ;
162
+ const expectedConfig : ProjectConfig = testConfig ;
152
163
const expectedManualData : AttributionData = {
153
164
attributions : testManualAttributions ,
154
165
resourcesToAttributions : testResourcesToManualAttributions ,
@@ -212,6 +223,9 @@ describe('loadFromFile', () => {
212
223
213
224
testStore . dispatch ( loadFromFile ( testParsedFileContent ) ) ;
214
225
expect ( getResources ( testStore . getState ( ) ) ) . toEqual ( expectedResources ) ;
226
+ expect ( getClassifications ( testStore . getState ( ) ) ) . toEqual (
227
+ expectedConfig . classifications ,
228
+ ) ;
215
229
expect ( getManualData ( testStore . getState ( ) ) ) . toEqual ( expectedManualData ) ;
216
230
expect ( getExternalData ( testStore . getState ( ) ) ) . toEqual ( expectedExternalData ) ;
217
231
expect ( getFrequentLicensesNameOrder ( testStore . getState ( ) ) ) . toEqual (
@@ -248,6 +262,7 @@ describe('loadFromFile', () => {
248
262
const testParsedFileContent : ParsedFileContent = {
249
263
metadata : EMPTY_PROJECT_METADATA ,
250
264
resources : testResources ,
265
+ config : testConfig ,
251
266
manualAttributions : {
252
267
attributions : testManualAttributions ,
253
268
resourcesToAttributions : testResourcesToManualAttributions ,
0 commit comments