create unit test for shouldShowUpgrade function
Issue-ID: VID-758
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: I11790efb51007275b8b1331dbfd31ada7eabd3e2
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
index 9e7a021..de859e4 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
@@ -216,13 +216,13 @@
* should return true if customer can upgrade a VFM *
****************************************************/
shouldShowUpgrade(node, serviceModelId): boolean {
- if (FeatureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE, this._store) &&
- (this.isThereAnUpdatedLatestVersion(serviceModelId)) || this.isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer(node, serviceModelId)) {
- return this.shouldShowButtonGeneric(node, VNFMethods.UPGRADE, serviceModelId);
+ return (this.isVfMoudleCouldBeUpgraded(node, serviceModelId))
+ && this.shouldShowButtonGeneric(node, VNFMethods.UPGRADE, serviceModelId) ;
}
- else {
- return false
- }
+
+ isVfMoudleCouldBeUpgraded(node, serviceModelId): boolean{
+ return (FeatureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE, this._store) &&
+ ((this.isThereAnUpdatedLatestVersion(serviceModelId)) || this.isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer(node, serviceModelId)))
}