summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
diff options
context:
space:
mode:
authorMateusz Gołuchowski <mateusz.goluchowski@nokia.com>2020-11-05 10:11:08 +0100
committerIkram Ikramullah <ikram@research.att.com>2020-11-12 14:21:25 +0000
commitd74f6cc4a47f4ebe94c6143f5ffb12b7f47c8fb6 (patch)
tree659d245c2d60edd94c19f06683916e0d37a9c79b /vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
parent182d036de5a7d64250fc5058f3cf361b9d823282 (diff)
Extend Modern UI for pnf usecase
Implemented functionalities to manage PNFs in modern UI: - Adding, removing, editing PNFs - PNF default generation based on 'min_instances' property - FE sends proper instantiation request to BE This is still impossible to deploy service with PNFs as VID's BE logic must be adjusted to generate proper request to SO as described in VID-695. Issue-ID: VID-694 Signed-off-by: Mateusz Goluchowski <mateusz.goluchowski@nokia.com> Change-Id: I5285ac2ab5e95665244ca29c6549249d9330b1ed
Diffstat (limited to 'vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts')
-rw-r--r--vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts37
1 files changed, 32 insertions, 5 deletions
diff --git a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
index f563cbc75..ad934cf79 100644
--- a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
@@ -22,7 +22,7 @@ describe("AaiService", () => {
let httpMock: HttpTestingController;
let aaiService: AaiService;
let mockFeatureFlagsService: FeatureFlagsService = mock(FeatureFlagsService);
- let store : NgRedux<AppState>;
+ let store: NgRedux<AppState>;
beforeAll(done => (async () => {
TestBed.configureTestingModule({
@@ -42,8 +42,6 @@ describe("AaiService", () => {
})().then(done).catch(done.fail));
-
-
describe('#resolve tests', () => {
test('aai service resolve should return the right object', () => {
let serviceInstance = new ServiceInstance();
@@ -173,8 +171,37 @@ describe("AaiService", () => {
});
});
+ describe('#Pnf modelCustomizationName initialization tests', () => {
+
+ test('initializePnfModelCustomizationName should not reinitialize modelCustomizationName when it exists', () => {
+ let serviceHierarchy = {
+ "pnfs": {
+ "pnfInstance": {
+ "modelCustomizationName": "existingName"
+ }
+ }
+ }
+
+ aaiService.initializePnfModelCustomizationName(serviceHierarchy);
+
+ expect(serviceHierarchy.pnfs["pnfInstance"].modelCustomizationName).toBe("existingName");
+ });
+
+ test('initializePnfModelCustomizationName should initialize modelCustomizationName when it doesnt exist', () => {
+ let serviceHierarchy = {
+ "pnfs": {
+ "pnfInstance": {}
+ }
+ }
+
+ aaiService.initializePnfModelCustomizationName(serviceHierarchy);
+
+ expect((serviceHierarchy.pnfs["pnfInstance"] as any).modelCustomizationName).toBe("pnfInstance");
+ });
+ });
+
function getTopology() {
- return {
+ return {
"vnfs": {
"2017-388_PASQUALE-vPE 0": {
"vfModules": {},
@@ -398,7 +425,7 @@ describe("AaiService", () => {
}
}
- function getMockActiveNetworks(){
+ function getMockActiveNetworks() {
return [
{
networkInstanceName: "networkInstanceName",