1 import {ComponentInfoService} from "../../../component-info/component-info.service";
2 import {AppState} from "../../../../../shared/store/reducers";
3 import {NgRedux} from "@angular-redux/store";
4 import {PnfModelInfo} from "./pnf.model.info";
5 import {getTestBed, TestBed} from "@angular/core/testing";
6 import {DynamicInputsService} from "../../dynamicInputs.service";
7 import {SharedTreeService} from "../../shared.tree.service";
8 import {DuplicateService} from "../../../duplicate/duplicate.service";
9 import {AaiService} from "../../../../../shared/services/aaiService/aai.service";
10 import {FeatureFlagsService} from "../../../../../shared/services/featureFlag/feature-flags.service";
11 import {IframeService} from "../../../../../shared/utils/iframe.service";
12 import {HttpClientTestingModule} from "@angular/common/http/testing";
13 import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing";
14 import {HttpClient, HttpHandler} from "@angular/common/http";
15 import {ComponentInfoType} from "../../../component-info/component-info-model";
16 import {PNFModel} from "../../../../../shared/models/pnfModel";
19 describe('PNF model info', () => {
21 let _componentInfoService: ComponentInfoService;
22 let _store: NgRedux<AppState>;
23 let _sharedTreeService;
24 let pnfModel: PnfModelInfo;
25 beforeEach(done => (async () => {
26 TestBed.configureTestingModule({
27 imports: [HttpClientTestingModule, NgReduxTestingModule],
40 await TestBed.compileComponents();
41 injector = getTestBed();
42 _store = injector.get(NgRedux);
43 _sharedTreeService = injector.get(SharedTreeService);
44 pnfModel = new PnfModelInfo(_sharedTreeService);
45 _componentInfoService = injector.get(ComponentInfoService);
46 })().then(done).catch(done.fail));
48 test('pnf model should be defined', () => {
49 expect(pnfModel).toBeDefined();
52 test('pnf model should defined extra details', () => {
53 expect(pnfModel.name).toEqual('pnfs');
54 expect(pnfModel.type).toEqual('PNF');
55 expect(pnfModel.typeName).toEqual('PNF');
56 expect(pnfModel.componentInfoType).toEqual(ComponentInfoType.PNF);
59 test('getTooltip should return "PNF"', () => {
60 let tooltip: string = pnfModel.getTooltip();
61 expect(tooltip).toEqual('PNF');
64 test('getType should return "pnf"', () => {
65 let tooltip: string = pnfModel.getType();
66 expect(tooltip).toEqual('pnf');
69 test('getNextLevelObject should be null', () => {
70 let nextLevel: any = pnfModel.getNextLevelObject();
71 expect(nextLevel).toBeNull();
74 test('isEcompGeneratedNaming should return false', () => {
75 let isEcompGeneratedNaming: boolean = pnfModel.isEcompGeneratedNaming(<any>{});
76 expect(isEcompGeneratedNaming).toBeFalsy();
79 test('getModel should return pnf model', () => {
80 expect(pnfModel.getModel({})).toBeInstanceOf(PNFModel);