diff options
author | 2019-12-05 15:48:34 +0200 | |
---|---|---|
committer | 2019-12-05 15:51:34 +0200 | |
commit | f6a327dfaf48614967e7e43c50dbab394498b786 (patch) | |
tree | 75caedf1e82533f9d133878fbb7fa20e99393d96 /vid-webpack-master/src/app/shared/storeUtil/utils/useTemplate/useTemplate.reducer.spec.ts | |
parent | 3aa4e38c1b2a69ea84bfad991ac9af09f2b0bb20 (diff) |
Create UseTemplate Action and Reducer to update state with template from BE.
Issue-ID: VID-724
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: Ie6de2dd42c21c1bf1c93b1569ec84050618f410a
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/storeUtil/utils/useTemplate/useTemplate.reducer.spec.ts')
-rw-r--r-- | vid-webpack-master/src/app/shared/storeUtil/utils/useTemplate/useTemplate.reducer.spec.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/useTemplate/useTemplate.reducer.spec.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/useTemplate/useTemplate.reducer.spec.ts new file mode 100644 index 000000000..e0f46e13a --- /dev/null +++ b/vid-webpack-master/src/app/shared/storeUtil/utils/useTemplate/useTemplate.reducer.spec.ts @@ -0,0 +1,18 @@ +import {ServiceInstance} from "../../../models/serviceInstance"; +import {useTemplateReducer} from "./useTemplate.reducer"; +import {CreateServiceInstanceFromTemplate, UseTemplateActions} from "./useTemplate.action"; + +test('#CREATE_SERVICE_INSTANCE_FROM_TEMPLATE should add new service instance from template to redux ', () => { + let serviceFromTemplateInstance: ServiceInstance = <any>{ + instanceName: 'templateInstanceName' + }; + let serviceState = useTemplateReducer(<any>{ + serviceInstance:{}}, + <CreateServiceInstanceFromTemplate> { + type: UseTemplateActions.CREATE_SERVICE_INSTANCE_FROM_TEMPLATE, + serviceModelId: 'serviceModelID', + serviceInstantiationTemplate: serviceFromTemplateInstance, + }) + expect (serviceState).toBeDefined(); + expect (serviceState.serviceInstance['serviceModelID'].instanceName).toEqual('templateInstanceName'); +}); |