blob: 136ecde96914267cf92552bb007a42e983cf840f [file] [log] [blame]
svishnev1eb66b72018-01-11 14:39:45 +02001/*
Einav Weiss Keidard2f57942018-02-14 14:00:07 +02002 * Copyright © 2016-2018 European Support Limited
AviZi280f8012017-06-09 02:39:56 +03003 *
svishnev091edfd2018-03-19 12:15:19 +02004 * Licensed under the Apache License, Version 2.0 (the 'License");
Michael Landoefa037d2017-02-19 12:57:33 +02005 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Einav Weiss Keidard2f57942018-02-14 14:00:07 +02007 *
svishnev1eb66b72018-01-11 14:39:45 +02008 * http://www.apache.org/licenses/LICENSE-2.0
Einav Weiss Keidard2f57942018-02-14 14:00:07 +02009 *
Michael Landoefa037d2017-02-19 12:57:33 +020010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
svishnev1eb66b72018-01-11 14:39:45 +020012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Michael Landoefa037d2017-02-19 12:57:33 +020015 */
Michael Landoefa037d2017-02-19 12:57:33 +020016import React from 'react';
Einav Weiss Keidard2f57942018-02-14 14:00:07 +020017import TestUtils from 'react-dom/test-utils';
18import ShallowRenderer from 'react-test-renderer/shallow';
Michael Landoefa037d2017-02-19 12:57:33 +020019import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/details/SoftwareProductDetails.js';
20import SoftwareProductDetailsView from 'sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsView.jsx';
AviZi280f8012017-06-09 02:39:56 +030021import {VSPEditorFactory} from 'test-utils/factories/softwareProduct/SoftwareProductEditorFactories.js';
22import {CategoryWithSubFactory} from 'test-utils/factories/softwareProduct/VSPCategoriesFactory.js';
23import {LicenseAgreementStoreFactory} from 'test-utils/factories/licenseModel/LicenseAgreementFactories.js';
24import {FeatureGroupStoreFactory} from 'test-utils/factories/licenseModel/FeatureGroupFactories.js';
25import {SchemaGenericFieldInfoFactory} from 'test-utils/factories/softwareProduct/SoftwareProductQSchemaFactory.js';
26import {default as VspQdataFactory, VspDataMapFactory} from 'test-utils/factories/softwareProduct/VspQdataFactory.js';
27import {FinalizedLicenseModelFactory} from 'test-utils/factories/licenseModel/LicenseModelFactories.js';
talig8e9c0652017-12-20 14:30:43 +020028import CurrentScreenFactory from 'test-utils/factories/common/CurrentScreenFactory.js';
Michael Landoefa037d2017-02-19 12:57:33 +020029
30describe('Software Product Details: ', function () {
31
talig8e9c0652017-12-20 14:30:43 +020032 let currentSoftwareProduct = {}, currentSoftwareProductWithLicensingData = {}, softwareProductCategories = [], licensingVersionsList = [], currentScreen = {},
AviZi280f8012017-06-09 02:39:56 +030033 finalizedLicenseModelList, licenseAgreementList, featureGroupsList, qdata = {}, dataMap = {}, genericFieldInfo = {}, qGenericFieldInfo = {};
Michael Landoefa037d2017-02-19 12:57:33 +020034 let dummyFunc = () => {};
35
AviZi280f8012017-06-09 02:39:56 +030036 beforeAll(function() {
37 finalizedLicenseModelList = FinalizedLicenseModelFactory.buildList(2);
38 currentSoftwareProduct = VSPEditorFactory.build({
39 id: 'RTRTG454545',
talig8e9c0652017-12-20 14:30:43 +020040 licensingVersion: undefined,
AviZi280f8012017-06-09 02:39:56 +030041 vendorId: finalizedLicenseModelList[0].id,
talig8e9c0652017-12-20 14:30:43 +020042 vendorName: finalizedLicenseModelList[0].name
AviZi280f8012017-06-09 02:39:56 +030043 });
44 softwareProductCategories = CategoryWithSubFactory.buildList(2, {}, {quantity: 1});
45 licenseAgreementList = LicenseAgreementStoreFactory.buildList(2);
talig8e9c0652017-12-20 14:30:43 +020046 licensingVersionsList = [
47 {
svishnev091edfd2018-03-19 12:15:19 +020048 'id':'0127b419e9574a11aab8e031a78fc534',
49 'name':'1.0','description':'Initial version',
50 'baseId':'','status':'Certified','creationTime':1506409288390,
51 'modificationTime':1506409288390,'additionalInfo':{'OptionalCreationMethods':['minor']}},
52 {'id':'ea159ffedd9a4f9a8a56d53ba66b7314','name':'2.0','description':'ggggg',
53 'baseId':'0127b419e9574a11aab8e031a78fc534','status':'Draft','creationTime':1508839019802,
54 'modificationTime':1508839019802,'additionalInfo':{'OptionalCreationMethods':[]}
55 }
talig8e9c0652017-12-20 14:30:43 +020056 ];
AviZi280f8012017-06-09 02:39:56 +030057 featureGroupsList = FeatureGroupStoreFactory.buildList(2, {referencingLicenseAgreements: [licenseAgreementList[0].id]});
58 qdata = VspQdataFactory.build();
59 dataMap = VspDataMapFactory.build();
60 currentSoftwareProductWithLicensingData = {
61 ...currentSoftwareProduct,
62 licensingData: {
63 licenseAgreement: licenseAgreementList[0].id,
64 featureGroups: [featureGroupsList[0].id]
talig8e9c0652017-12-20 14:30:43 +020065 },
66 licensingVersion : licensingVersionsList[0].id
Michael Landoefa037d2017-02-19 12:57:33 +020067 };
AviZi280f8012017-06-09 02:39:56 +030068 genericFieldInfo = {
69 'name': {
70 isValid: true,
71 errorText: '',
72 validations: [{type: 'validateName', data: true}, {type: 'maxLength', data: 120}, {
73 type: 'required',
74 data: true
75 }]
76 },
77 'description': {
78 isValid: true,
79 errorText: '',
aribeirocba52c92021-07-12 15:10:19 +010080 validations: [{type: 'validateName', data: true}, {type: 'required', data: true}]
AviZi280f8012017-06-09 02:39:56 +030081 }
82 };
83 qGenericFieldInfo = SchemaGenericFieldInfoFactory.build();
talig8e9c0652017-12-20 14:30:43 +020084 currentScreen = CurrentScreenFactory.build();
Michael Landoefa037d2017-02-19 12:57:33 +020085 });
86
87 it('should mapper exist', () => {
AviZi280f8012017-06-09 02:39:56 +030088 expect(mapStateToProps).toBeTruthy();
Michael Landoefa037d2017-02-19 12:57:33 +020089 });
90
91 it('should mapper return vsp basic data', () => {
AviZi280f8012017-06-09 02:39:56 +030092
Michael Landoefa037d2017-02-19 12:57:33 +020093 var obj = {
talig8e9c0652017-12-20 14:30:43 +020094 currentScreen,
Michael Landoefa037d2017-02-19 12:57:33 +020095 softwareProduct: {
96 softwareProductEditor: {
AviZi280f8012017-06-09 02:39:56 +030097 data: currentSoftwareProduct,
talig8e9c0652017-12-20 14:30:43 +020098 genericFieldInfo,
99 licensingVersionsList
Michael Landoefa037d2017-02-19 12:57:33 +0200100 },
AviZi280f8012017-06-09 02:39:56 +0300101 softwareProductCategories,
Michael Landoefa037d2017-02-19 12:57:33 +0200102 softwareProductQuestionnaire: {
AviZi280f8012017-06-09 02:39:56 +0300103 qdata,
104 genericFieldInfo: qGenericFieldInfo,
105 dataMap
Michael Landoefa037d2017-02-19 12:57:33 +0200106 }
107 },
AviZi280f8012017-06-09 02:39:56 +0300108 finalizedLicenseModelList,
Michael Landoefa037d2017-02-19 12:57:33 +0200109 licenseModel: {
110 licenseAgreement: {
111 licenseAgreementList: []
112 },
113 featureGroup: {
114 featureGroupsList: []
115 }
svishnev091edfd2018-03-19 12:15:19 +0200116 },
117 archivedLicenseModelList: [],
118 archivedSoftwareProductList: []
Michael Landoefa037d2017-02-19 12:57:33 +0200119 };
120
121 var result = mapStateToProps(obj);
122 expect(result.currentSoftwareProduct).toEqual(currentSoftwareProduct);
123 expect(result.finalizedLicenseModelList).toEqual(finalizedLicenseModelList);
124 expect(result.finalizedLicenseModelList.length).toBeGreaterThan(0);
AviZi280f8012017-06-09 02:39:56 +0300125 expect(finalizedLicenseModelList[0]).toMatchObject({
Michael Landoefa037d2017-02-19 12:57:33 +0200126 id: result.currentSoftwareProduct.vendorId,
talig8e9c0652017-12-20 14:30:43 +0200127 name: result.currentSoftwareProduct.vendorName
Michael Landoefa037d2017-02-19 12:57:33 +0200128 });
AviZi280f8012017-06-09 02:39:56 +0300129 expect(result.softwareProductCategories).toEqual(softwareProductCategories);
Michael Landoefa037d2017-02-19 12:57:33 +0200130 expect(result.licenseAgreementList).toEqual([]);
131 expect(result.featureGroupsList).toEqual([]);
AviZi280f8012017-06-09 02:39:56 +0300132 expect(result.qdata).toEqual(qdata);
133 expect(result.dataMap).toEqual(dataMap);
134 expect(result.isFormValid).toEqual(true);
Michael Landoefa037d2017-02-19 12:57:33 +0200135 });
136
137 it('should mapper return vsp data with selected licenseAgreement and featureGroup', () => {
AviZi280f8012017-06-09 02:39:56 +0300138
Michael Landoefa037d2017-02-19 12:57:33 +0200139 var obj = {
talig8e9c0652017-12-20 14:30:43 +0200140 currentScreen,
Michael Landoefa037d2017-02-19 12:57:33 +0200141 softwareProduct: {
142 softwareProductEditor: {
AviZi280f8012017-06-09 02:39:56 +0300143 data: currentSoftwareProductWithLicensingData,
talig8e9c0652017-12-20 14:30:43 +0200144 genericFieldInfo,
145 licensingVersionsList
Michael Landoefa037d2017-02-19 12:57:33 +0200146 },
AviZi280f8012017-06-09 02:39:56 +0300147 softwareProductCategories,
Michael Landoefa037d2017-02-19 12:57:33 +0200148 softwareProductQuestionnaire: {
AviZi280f8012017-06-09 02:39:56 +0300149 qdata,
150 genericFieldInfo: qGenericFieldInfo,
151 dataMap
Michael Landoefa037d2017-02-19 12:57:33 +0200152 }
153 },
aribeirocba52c92021-07-12 15:10:19 +0100154 finalizedLicenseModelList: finalizedLicenseModelList,
svishnev091edfd2018-03-19 12:15:19 +0200155 archivedLicenseModelList: [],
156 archivedSoftwareProductList: [],
Michael Landoefa037d2017-02-19 12:57:33 +0200157 licenseModel: {
158 licenseAgreement: {
159 licenseAgreementList: licenseAgreementList
160 },
161 featureGroup: {
162 featureGroupsList: featureGroupsList
163 }
164 }
165 };
166
167 var result = mapStateToProps(obj);
AviZi280f8012017-06-09 02:39:56 +0300168 expect(result.currentSoftwareProduct).toEqual(currentSoftwareProductWithLicensingData);
Michael Landoefa037d2017-02-19 12:57:33 +0200169 expect(result.finalizedLicenseModelList).toEqual(finalizedLicenseModelList);
170 expect(result.finalizedLicenseModelList.length).toBeGreaterThan(0);
AviZi280f8012017-06-09 02:39:56 +0300171 expect(result.finalizedLicenseModelList[0]).toMatchObject({
Michael Landoefa037d2017-02-19 12:57:33 +0200172 id: result.currentSoftwareProduct.vendorId,
talig8e9c0652017-12-20 14:30:43 +0200173 name: result.currentSoftwareProduct.vendorName
Michael Landoefa037d2017-02-19 12:57:33 +0200174 });
AviZi280f8012017-06-09 02:39:56 +0300175 expect(result.softwareProductCategories).toEqual(softwareProductCategories);
Michael Landoefa037d2017-02-19 12:57:33 +0200176 expect(result.licenseAgreementList).toEqual(licenseAgreementList);
AviZi280f8012017-06-09 02:39:56 +0300177 expect(result.licenseAgreementList[0]).toMatchObject({...licenseAgreementList[0], id: result.currentSoftwareProduct.licensingData.licenseAgreement});
Michael Landoefa037d2017-02-19 12:57:33 +0200178 result.currentSoftwareProduct.licensingData.featureGroups.forEach(fg => {
AviZi280f8012017-06-09 02:39:56 +0300179 expect(featureGroupsList[0]).toMatchObject({...featureGroupsList[0], id: fg});
Michael Landoefa037d2017-02-19 12:57:33 +0200180 });
AviZi280f8012017-06-09 02:39:56 +0300181 expect(result.qdata).toEqual(qdata);
Michael Landoefa037d2017-02-19 12:57:33 +0200182 });
183
184 it('VSP Details view test', () => {
AviZi280f8012017-06-09 02:39:56 +0300185
Michael Landoefa037d2017-02-19 12:57:33 +0200186 let params = {
talig8e9c0652017-12-20 14:30:43 +0200187 ...currentScreen.props,
AviZi280f8012017-06-09 02:39:56 +0300188 currentSoftwareProduct,
189 softwareProductCategories,
190 qdata,
191 dataMap,
192 isFormValid: true,
193 finalizedLicenseModelList,
194 licenseAgreementList,
195 featureGroupsList,
talig8e9c0652017-12-20 14:30:43 +0200196 licensingVersionsList,
AviZi280f8012017-06-09 02:39:56 +0300197 genericFieldInfo,
198 qGenericFieldInfo,
Michael Landoefa037d2017-02-19 12:57:33 +0200199 };
Einav Weiss Keidard2f57942018-02-14 14:00:07 +0200200 const renderer = new ShallowRenderer();
Michael Landoefa037d2017-02-19 12:57:33 +0200201 renderer.render(
202 <SoftwareProductDetailsView
203 {...params}
204 onSubmit = {dummyFunc}
205 onDataChanged = {dummyFunc}
206 onValidityChanged = {dummyFunc}
207 onQDataChanged = {dummyFunc}
208 onVendorParamChanged = {dummyFunc}/>
209 );
210 let renderedOutput = renderer.getRenderOutput();
AviZi280f8012017-06-09 02:39:56 +0300211 expect(renderedOutput).toBeTruthy();
talig8e9c0652017-12-20 14:30:43 +0200212 expect(renderedOutput.props.children.props.isReadOnlyMode).toBe(false);
213
Michael Landoefa037d2017-02-19 12:57:33 +0200214 });
215
216 it('in view: should change vendorId and update vsp licensing-version', done => {
AviZi280f8012017-06-09 02:39:56 +0300217
Michael Landoefa037d2017-02-19 12:57:33 +0200218 let params = {
AviZi280f8012017-06-09 02:39:56 +0300219 currentSoftwareProduct: currentSoftwareProductWithLicensingData,
220 softwareProductCategories,
221 qdata,
222 dataMap,
223 isFormValid: true,
224 genericFieldInfo,
225 qGenericFieldInfo,
226 finalizedLicenseModelList,
227 licenseAgreementList,
talig8e9c0652017-12-20 14:30:43 +0200228 licensingVersionsList,
AviZi280f8012017-06-09 02:39:56 +0300229 featureGroupsList
Michael Landoefa037d2017-02-19 12:57:33 +0200230 };
231 const onVendorChangedListener = (deltaData) => {
AviZi280f8012017-06-09 02:39:56 +0300232 expect(deltaData.vendorId).toEqual(finalizedLicenseModelList[1].id);
talig8e9c0652017-12-20 14:30:43 +0200233 expect(deltaData.vendorName).toEqual(finalizedLicenseModelList[1].name);
Michael Landoefa037d2017-02-19 12:57:33 +0200234 expect(deltaData.licensingVersion).toEqual('');
235 expect(deltaData.licensingData).toEqual({});
236 done();
237 };
238
239 var vspDetailsView = TestUtils.renderIntoDocument(<SoftwareProductDetailsView
240 currentSoftwareProduct = {params.currentSoftwareProduct}
241 softwareProductCategories = {params.softwareProductCategories}
242 qdata = {params.qdata}
AviZi280f8012017-06-09 02:39:56 +0300243 qGenericFieldInfo = {params.qGenericFieldInfo}
244 genericFieldInfo = {params.genericFieldInfo}
talig8e9c0652017-12-20 14:30:43 +0200245 licensingVersionsList={params.licensingVersionsList}
AviZi280f8012017-06-09 02:39:56 +0300246 isFormValid={params.isFormValid}
247 dataMap={params.dataMap}
Michael Landoefa037d2017-02-19 12:57:33 +0200248 finalizedLicenseModelList = {params.finalizedLicenseModelList}
249 licenseAgreementList = {params.licenseAgreementList}
250 featureGroupsList = {params.featureGroupsList}
251 onSubmit = {dummyFunc}
252 onDataChanged = {dummyFunc}
253 onValidityChanged = {dummyFunc}
254 onQDataChanged = {dummyFunc}
255 onVendorParamChanged = {(deltaData) => onVendorChangedListener(deltaData)}/>);
AviZi280f8012017-06-09 02:39:56 +0300256 expect(vspDetailsView).toBeTruthy();
257 vspDetailsView.onVendorParamChanged({vendorId: finalizedLicenseModelList[1].id});
Michael Landoefa037d2017-02-19 12:57:33 +0200258 });
259
260 it('in view: should change licensing-version and update licensing data', done => {
261 let params = {
262 currentSoftwareProduct: currentSoftwareProduct,
AviZi280f8012017-06-09 02:39:56 +0300263 softwareProductCategories,
264 qdata,
265 dataMap,
talig8e9c0652017-12-20 14:30:43 +0200266 licensingVersionsList,
AviZi280f8012017-06-09 02:39:56 +0300267 isFormValid: true,
268 genericFieldInfo,
269 qGenericFieldInfo,
270 finalizedLicenseModelList,
271 licenseAgreementList,
272 featureGroupsList
Michael Landoefa037d2017-02-19 12:57:33 +0200273 };
274 const onVendorChangedListener = (deltaData) => {
AviZi280f8012017-06-09 02:39:56 +0300275 expect(deltaData.vendorId).toEqual(finalizedLicenseModelList[1].id);
talig8e9c0652017-12-20 14:30:43 +0200276 expect(deltaData.vendorName).toEqual(finalizedLicenseModelList[1].name);
277 expect(deltaData.licensingVersion).toEqual(licensingVersionsList[1]);
Michael Landoefa037d2017-02-19 12:57:33 +0200278 expect(deltaData.licensingData).toEqual({});
279 done();
280 };
281
282 let vspDetailsView = TestUtils.renderIntoDocument(<SoftwareProductDetailsView
283 {...params}
284 onSubmit = {dummyFunc}
285 onDataChanged = {dummyFunc}
286 onValidityChanged = {dummyFunc}
287 onQDataChanged = {dummyFunc}
288 onVendorParamChanged = {(deltaData) => onVendorChangedListener(deltaData)}/>);
AviZi280f8012017-06-09 02:39:56 +0300289 expect(vspDetailsView).toBeTruthy();
talig8e9c0652017-12-20 14:30:43 +0200290 vspDetailsView.onVendorParamChanged({vendorId: finalizedLicenseModelList[1].id, licensingVersion: licensingVersionsList[1]});
Michael Landoefa037d2017-02-19 12:57:33 +0200291 });
292
293 it('in view: should change subcategory', done => {
294 let params = {
295 currentSoftwareProduct: currentSoftwareProduct,
AviZi280f8012017-06-09 02:39:56 +0300296 softwareProductCategories,
297 qdata,
298 dataMap,
299 isFormValid: true,
300 genericFieldInfo,
301 qGenericFieldInfo,
talig8e9c0652017-12-20 14:30:43 +0200302 licensingVersionsList,
AviZi280f8012017-06-09 02:39:56 +0300303 finalizedLicenseModelList,
304 licenseAgreementList,
305 featureGroupsList
Michael Landoefa037d2017-02-19 12:57:33 +0200306 };
307 const onDataChangedListener = ({category, subCategory}) => {
AviZi280f8012017-06-09 02:39:56 +0300308 expect(category).toEqual(softwareProductCategories[1].uniqueId);
309 expect(subCategory).toEqual(softwareProductCategories[1].subcategories[0].uniqueId);
Michael Landoefa037d2017-02-19 12:57:33 +0200310 done();
311 };
312
313 let vspDetailsView = TestUtils.renderIntoDocument(<SoftwareProductDetailsView
314 {...params}
315 onSubmit = {dummyFunc}
316 onDataChanged = {({category, subCategory}) => onDataChangedListener({category, subCategory})}
317 onValidityChanged = {dummyFunc}
318 onQDataChanged = {dummyFunc}
319 onVendorParamChanged = {dummyFunc}/>);
AviZi280f8012017-06-09 02:39:56 +0300320 expect(vspDetailsView).toBeTruthy();
321 vspDetailsView.onSelectSubCategory(softwareProductCategories[1].subcategories[0].uniqueId);
Michael Landoefa037d2017-02-19 12:57:33 +0200322 });
323
324 it('in view: should change feature groups', done => {
AviZi280f8012017-06-09 02:39:56 +0300325
Michael Landoefa037d2017-02-19 12:57:33 +0200326 let params = {
AviZi280f8012017-06-09 02:39:56 +0300327 currentSoftwareProduct: currentSoftwareProductWithLicensingData,
328 softwareProductCategories,
329 qdata,
330 dataMap,
331 isFormValid: true,
332 genericFieldInfo,
333 qGenericFieldInfo,
talig8e9c0652017-12-20 14:30:43 +0200334 licensingVersionsList,
AviZi280f8012017-06-09 02:39:56 +0300335 finalizedLicenseModelList,
336 licenseAgreementList,
337 featureGroupsList
Michael Landoefa037d2017-02-19 12:57:33 +0200338 };
339 const onDataChangedListener = ({licensingData}) => {
AviZi280f8012017-06-09 02:39:56 +0300340 expect(licensingData.licenseAgreement).toEqual(licenseAgreementList[0].id);
Michael Landoefa037d2017-02-19 12:57:33 +0200341 expect(licensingData.featureGroups).toEqual([
AviZi280f8012017-06-09 02:39:56 +0300342 {enum: featureGroupsList[0].id, title: featureGroupsList[0].name},
343 {enum: featureGroupsList[1].id, title: featureGroupsList[1].name}
Michael Landoefa037d2017-02-19 12:57:33 +0200344 ]);
345 done();
346 };
347
348 let vspDetailsView = TestUtils.renderIntoDocument(<SoftwareProductDetailsView
349 {...params}
350 onSubmit = {dummyFunc}
351 onDataChanged = {({licensingData}) => onDataChangedListener({licensingData})}
352 onValidityChanged = {dummyFunc}
353 onQDataChanged = {dummyFunc}
354 onVendorParamChanged = {dummyFunc}/>);
AviZi280f8012017-06-09 02:39:56 +0300355 expect(vspDetailsView).toBeTruthy();
Michael Landoefa037d2017-02-19 12:57:33 +0200356 vspDetailsView.onFeatureGroupsChanged({featureGroups: [
AviZi280f8012017-06-09 02:39:56 +0300357 {enum: featureGroupsList[0].id, title: featureGroupsList[0].name},
358 {enum: featureGroupsList[1].id, title: featureGroupsList[1].name}
Michael Landoefa037d2017-02-19 12:57:33 +0200359 ]});
360 });
361
AviZi280f8012017-06-09 02:39:56 +0300362
talig8e9c0652017-12-20 14:30:43 +0200363 it('in view: should change license agreement', done => {
Michael Landoefa037d2017-02-19 12:57:33 +0200364 let params = {
AviZi280f8012017-06-09 02:39:56 +0300365 currentSoftwareProduct: currentSoftwareProductWithLicensingData,
366 softwareProductCategories,
367 qdata,
368 dataMap,
369 isFormValid: true,
370 genericFieldInfo,
371 qGenericFieldInfo,
talig8e9c0652017-12-20 14:30:43 +0200372 licensingVersionsList,
AviZi280f8012017-06-09 02:39:56 +0300373 finalizedLicenseModelList,
374 licenseAgreementList,
375 featureGroupsList
Michael Landoefa037d2017-02-19 12:57:33 +0200376 };
377 const onDataChangedListener = ({licensingData}) => {
AviZi280f8012017-06-09 02:39:56 +0300378 expect(licensingData.licenseAgreement).toEqual(licenseAgreementList[1].id);
Michael Landoefa037d2017-02-19 12:57:33 +0200379 expect(licensingData.featureGroups).toEqual([]);
380 done();
381 };
382
383 let vspDetailsView = TestUtils.renderIntoDocument(<SoftwareProductDetailsView
384 {...params}
385 onSubmit = {dummyFunc}
386 onDataChanged = {({licensingData}) => onDataChangedListener({licensingData})}
387 onValidityChanged = {dummyFunc}
388 onQDataChanged = {dummyFunc}
389 onVendorParamChanged = {dummyFunc}/>);
AviZi280f8012017-06-09 02:39:56 +0300390 expect(vspDetailsView).toBeTruthy();
391 vspDetailsView.onLicensingDataChanged({licenseAgreement: licenseAgreementList[1].id, featureGroups: []});
Michael Landoefa037d2017-02-19 12:57:33 +0200392 });
talig8e9c0652017-12-20 14:30:43 +0200393
Michael Landoefa037d2017-02-19 12:57:33 +0200394});