summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master')
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts6
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts51
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts2
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts2
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html11
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts12
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts5
7 files changed, 44 insertions, 45 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts
index 427696561..a71d9424e 100644
--- a/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts
@@ -63,13 +63,13 @@ describe('Browse SDC', function () {
});
- it(`browse sdc should open instantiation template modal if service hasTemplate is true`, function () {
+ it(`browse sdc should open instantiation template modal if service isInstantiationTemplateExists is true`, function () {
const SERVICE_MODEL_ID: string = '74fa72dd-012b-49c3-800d-06b12bcaf1a0';
cy.readFile('cypress/support/jsonBuilders/mocks/jsons/bug616888/list-services.json').then((res) => {
- res.services = res.services.map((service: { uuid: string, hasTemplate: boolean }) => {
+ res.services = res.services.map((service: { uuid: string, isInstantiationTemplateExists: boolean }) => {
if (service.uuid === SERVICE_MODEL_ID) {
- service.hasTemplate = true;
+ service.isInstantiationTemplateExists = true;
}
return service;
});
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
index 5afcc9748..40306fcfd 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
@@ -52,16 +52,25 @@ describe('Drawing Board: Instantiation Templates', function () {
.fillVnfPopup()
.getDrawingBoardDeployBtn().click()
.wait('@expectedPostAsyncInstantiation').then(xhr => {
- const vnfRequest = bodyOf(xhr).vnfs['vProbe_NC_VNF 0_1'];
-
- expect(vnfRequest.action).equals("Create");
- expect(vnfRequest.rollbackOnFailure).equals("true");
- expect(vnfRequest.originalName).equals("vProbe_NC_VNF 0");
- expect(vnfRequest.productFamilyId).equals("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- expect(vnfRequest.lcpCloudRegionId).equals("hvf6");
- expect(vnfRequest.lineOfBusiness).equals("zzz1");
- expect(vnfRequest.platformName).equals("xxx1");
- expect(vnfRequest.tenantId).equals("229bcdc6eaeb4ca59d55221141d01f8e");
+ const vnfRequest = bodyOf(xhr).vnfs['vProbe_NC_VNF 0_1'];
+
+ expect(vnfRequest.action).equals("Create");
+ expect(vnfRequest.rollbackOnFailure).equals("true");
+ expect(vnfRequest.originalName).equals("vProbe_NC_VNF 0");
+ expect(vnfRequest.productFamilyId).equals("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ expect(vnfRequest.lcpCloudRegionId).equals("hvf6");
+ expect(vnfRequest.lineOfBusiness).equals("zzz1");
+ expect(vnfRequest.platformName).equals("xxx1");
+ expect(vnfRequest.tenantId).equals("229bcdc6eaeb4ca59d55221141d01f8e");
+
+
+ // check instance name not change if empty
+ editNode('node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0', 0)
+ .clearInput('instanceName');
+ cy.getElementByDataTestsId('form-set').click({force: true}).then((done) => {
+ editNode('node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0', 0)
+ .getElementByDataTestsId('instanceName').should('be.empty')
+ });
});
});
@@ -73,7 +82,7 @@ describe('Drawing Board: Instantiation Templates', function () {
.getTagElementContainsText('button', 'Duplicate').click()
.getDrawingBoardDeployBtn().click()
.wait('@expectedPostAsyncInstantiation').then(xhr => {
- expect(Object.keys(bodyOf(xhr).vnfs).length).equals(numberOfDuplicate + 1);
+ expect(Object.keys(bodyOf(xhr).vnfs).length).equals(numberOfDuplicate + 1);
});
});
@@ -143,11 +152,11 @@ describe('Drawing Board: Instantiation Templates', function () {
.click({force: true});
editNode(`node-c09e4530-8fd8-418f-9483-2f57ce927b05-${module1CustomizationId}`, 1);
- cy.clearInput("instanceName");
- cy.typeToInput("instanceName", newVfModuleName);
- cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
- cy.selectDropdownOptionByText('tenant', 'DN5242-Nov21-T1');
- cy.getElementByDataTestsId('form-set').click();
+ cy.clearInput("instanceName");
+ cy.typeToInput("instanceName", newVfModuleName);
+ cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
+ cy.selectDropdownOptionByText('tenant', 'DN5242-Nov21-T1');
+ cy.getElementByDataTestsId('form-set').click();
// Then...
cy.getReduxState().then((state) => {
@@ -251,7 +260,7 @@ describe('Drawing Board: Instantiation Templates', function () {
});
- it(`Given a stored template of Network - - it is loaded`, () => {
+ it(`Given a stored template of Network - - it is loaded`, () => {
loadDrawingBoardWithRecreateModeNetwork();
@@ -261,7 +270,7 @@ describe('Drawing Board: Instantiation Templates', function () {
assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd_network();
});
- it(`Given a stored template of Network - User can remove existing network`, () => {
+ it(`Given a stored template of Network - User can remove existing network`, () => {
loadDrawingBoardWithRecreateModeNetwork();
@@ -286,9 +295,9 @@ describe('Drawing Board: Instantiation Templates', function () {
// add new node
addNewNode('node-SR-IOV Provider 2-1-add-btn')
- .fillNetworkPopup()
- .getDrawingBoardDeployBtn().click()
- .wait('@expectedPostAsyncInstantiation').then(xhr => {
+ .fillNetworkPopup()
+ .getDrawingBoardDeployBtn().click()
+ .wait('@expectedPostAsyncInstantiation').then(xhr => {
const networkRequest = bodyOf(xhr).networks['SR-IOV Provider 2-1_1'];
expect(networkRequest.action).equals("Create");
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
index 168a93617..dd51457e9 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
@@ -94,7 +94,6 @@ describe('Template', () => {
cy.get(`#header-instantiationStatus`).contains('Instantiation Status');
cy.get(`#header-region`).contains('Region');
cy.get(`#header-tenant`).contains('Tenant');
- cy.get(`#header-aicZone`).contains('AIC Zone');
// check table body row
cy.getElementByDataTestsId(`userId-${templateJobIdFromE2EFile}`).contains('16807000');
@@ -104,7 +103,6 @@ describe('Template', () => {
cy.getElementByDataTestsId(`summary-${templateJobIdFromE2EFile}`).contains('vnf: 1, vfModule: 2, volumeGroup: 1');
cy.getElementByDataTestsId(`region-${templateJobIdFromE2EFile}`).contains('hvf3 (SOMENAME)');
cy.getElementByDataTestsId(`tenant-${templateJobIdFromE2EFile}`).contains('greatTenant');
- cy.getElementByDataTestsId(`aicZone-${templateJobIdFromE2EFile}`).contains('NFTJSSSS-NFT1');
//check load button is disabled
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts
index e82ea5d85..acfaf78ab 100644
--- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts
+++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts
@@ -167,7 +167,7 @@ export class SharedControllersService {
placeHolder: (!isEcompGeneratedNaming) ? 'Instance name' : 'Automatically generated when not provided',
validations: validations,
isVisible : true,
- value : (!isEcompGeneratedNaming || (!_.isNil(instance) && !_.isNil(instance.instanceName)))
+ value : (!isEcompGeneratedNaming || (!_.isNil(instance) && !_.isNil(instance.instanceName) && instance.instanceName !== ""))
? this._basicControlGenerator.getDefaultInstanceName(instance, model) : null,
onKeypress : (event) => {
const pattern:RegExp = ControlGeneratorUtil.INSTANCE_NAME_REG_EX;
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
index 84783c273..39c6da4f4 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
@@ -56,7 +56,6 @@
<th class="header-title" id="header-summary">Summary</th>
<th class="header-title" id="header-region">Region</th>
<th class="header-title" id="header-tenant">Tenant</th>
- <th class="header-title" id="header-aicZone">AIC Zone</th>
</tr>
</thead>
<tbody>
@@ -139,16 +138,6 @@
</custom-ellipsis>
</div>
</td>
- <td>
- <div>
- <custom-ellipsis
- [dataTestId]="'aicZone-' + item.jobId"
- [id]="item.aicZone"
- [value]="item.aicZone"
- [breakWord]="true">
- </custom-ellipsis>
- </div>
- </td>
</tr>
</tbody>
</table>
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
index 78614c0f8..a479e0cbf 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.spec.ts
@@ -17,9 +17,6 @@ class ActivatedRouteMock<T> {
}
}
-//
-
-
class MockAppStore {}
describe('instantiation templates modal service', () => {
@@ -123,7 +120,6 @@ describe('instantiation templates modal service', () => {
expect(tableRows[0].instantiationStatus).toEqual('FAILED');
expect(tableRows[0].region).toEqual('hvf6 (AAA1)');
expect(tableRows[0].tenant).toEqual('AIN Web Tool-15-D-SSPtestcustome');
- expect(tableRows[0].aicZone).toEqual('VSDKYUTP-BAN1');
expect(tableRows[0].jobId).toEqual('9f88fdb5-bb47-4bf3-8c5f-98f1ad0ec87c');
});
@@ -136,6 +132,14 @@ describe('instantiation templates modal service', () => {
expect(result.region).toEqual('regionId (OWNER)');
});
+ test('getRegion if null should return empty string', () => {
+ let result: InstantiationTemplatesRowModel = new InstantiationTemplatesRowModel({
+ owningEntityName: 'att-owner',
+ regionId: null
+ });
+ expect(result.region).toEqual('(OWNER)');
+ });
+
test('getCloudOwner should not return owningEntityName if not exist', () => {
let result: InstantiationTemplatesRowModel = new InstantiationTemplatesRowModel({owningEntityName: null, regionId: 'regionId'});
expect(result.region).toEqual('regionId');
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
index f2eda9df3..56f76b32f 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
@@ -10,7 +10,6 @@ export class InstantiationTemplatesRowModel extends InstantiationBase{
readonly summary?: string;
readonly region?: string;
readonly tenant?: string;
- readonly aicZone?: string;
constructor(data) {
super(data);
@@ -21,7 +20,6 @@ export class InstantiationTemplatesRowModel extends InstantiationBase{
this.summary = this.convertRequestSummaryFromMapToString(data.requestSummary);
this.region = this.getRegion(data.regionId, data.owningEntityName);
this.tenant = !_.isNil(data.tenantName) ? data.tenantName : null;
- this.aicZone = !_.isNil(data.aicZoneName) ? data.aicZoneName : null;
}
@@ -36,7 +34,8 @@ export class InstantiationTemplatesRowModel extends InstantiationBase{
getRegion = (regionId: string, owningEntityName: string): string => {
const convertOwning = !_.isNil(owningEntityName) ? `(${this.getCloudOwner(owningEntityName)})` : '';
- return `${regionId} ${convertOwning}`.trim();
+ const region = !_.isNil(regionId) ? regionId : '';
+ return `${region} ${convertOwning}`.trim();
};