summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts')
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
index 8905d4110..3499377ac 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
@@ -80,6 +80,7 @@ describe('Shared Tree Service', () => {
let service: SharedTreeService;
let _objectToInstanceTreeService: ObjectToInstanceTreeService;
let store: NgRedux<AppState>;
+
beforeAll(done => (async () => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule, NgReduxTestingModule, SdcUiComponentsModule],
@@ -392,6 +393,34 @@ describe('Shared Tree Service', () => {
expect(isDiffCustomizationUuidResponse).toEqual(expected);
});
+ each([
+ [false, true, true, false],
+ [true, true, true, true],
+ [true, true, false, true],
+ [true, false, true, true],
+ [true, false, false, false],
+ ]).
+ test('when flag is %s the UpdatedLatestVersion is %s and Vfmodule CustomizationUuid Differ is %s isShouldShowButtonGenericMustToBeCalled should return %s', (
+ flag: boolean,
+ isThereAnUpdatedLatestVersion: boolean,
+ isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer: boolean,
+ isShouldShowButtonGenericMustToBeCalled: boolean
+ ) => {
+ let node = <any> {};
+ let serviceModelId : string = '08c5fa17-769a-4231-bd92-aed4b0ed086d';
+ jest.spyOn(store, 'getState').mockReturnValue(<any>{
+ global: {
+ "flags": {
+ "FLAG_FLASH_REPLACE_VF_MODULE": flag,
+ },
+ }
+ });
+ spyOn(service, 'isThereAnUpdatedLatestVersion').and.returnValue(isThereAnUpdatedLatestVersion);
+ spyOn(service, 'isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer').and.returnValue(isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer);
+
+ expect(service.isVfMoudleCouldBeUpgraded(node, serviceModelId)).toEqual(isShouldShowButtonGenericMustToBeCalled);
+ });
+
});
function getStore() {