diff options
author | 2019-12-16 13:22:19 +0000 | |
---|---|---|
committer | 2019-12-16 13:22:19 +0000 | |
commit | 31e02ef034fddefe26d48f497462015e7976f0b5 (patch) | |
tree | 9b17b52fddebd998175296aa139df0751409046a /vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts | |
parent | f279146ffd395d446a58be75d6786de41b6a9381 (diff) | |
parent | f959829f573644c2b4d5ada940348ec4893d8a8c (diff) |
Merge "When opening new VNF modal the modal should be empty."
Diffstat (limited to 'vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts')
-rw-r--r-- | vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts index 077d849e6..7e2d3f942 100644 --- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts @@ -1,9 +1,10 @@ import {getTestBed, TestBed} from '@angular/core/testing'; import {AaiService} from "../../../services/aaiService/aai.service"; -import {FormControlModel, ValidatorModel, ValidatorOptions} from "../../../models/formControlModels/formControl.model"; +import {FormControlModel} from "../../../models/formControlModels/formControl.model"; import {FeatureFlagsService} from "../../../services/featureFlag/feature-flags.service"; import {BasicControlGenerator} from "./basic.control.generator"; import {NgRedux} from '@angular-redux/store'; +import each from "jest-each"; import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; import {FileFormControl} from "../../../models/formControlModels/fileFormControl.model"; @@ -81,5 +82,27 @@ describe('Basic Control Generator', () => { "supplementaryFile_hidden_content" ]); }); -}); + each([ + [null, false], + [{}, true] + ]). + test('retrieveInstanceIfUpdateMode returns %s if update mode is %s', (expected, isUpdateModalMode) => { + //given + const store= <any>{ + getState() { + return { + global: { + isUpdateModalMode + } + }}}; + const instance = {}; + + //when + let retrievedInstance = service.retrieveInstanceIfUpdateMode (store, instance); + //then + expect(retrievedInstance).toEqual(expected); + + }); + +}); |