summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts')
-rw-r--r--vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts24
1 files changed, 22 insertions, 2 deletions
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts b/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
index 8b25488b6..9698f47bb 100644
--- a/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
+++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/vid.mock.ts
@@ -6,6 +6,7 @@ declare namespace Cypress {
initAuditInfoMSO: typeof initAuditInfoMSO;
initAuditInfoMSOALaCarte: typeof initAuditInfoMSOALaCarte;
initAsyncInstantiation : typeof initAsyncInstantiation;
+ mockLatestVersionForService : typeof mockLatestVersionForService;
}
}
@@ -106,14 +107,31 @@ function initAsyncInstantiation(response? : JSON, delay?: number, status?: numbe
})
}
+function mockLatestVersionForService(uuidObject :any) {
+ if(uuidObject && uuidObject.serviceUuid && uuidObject.invariantId){
+ cy.server().route({
+ url: Cypress.config('baseUrl') + '/aai_get_newest_model_version_by_invariant/' + uuidObject.invariantId,
+ method: 'GET',
+ status: 200,
+ response: {
+ "modelVersionId": uuidObject.serviceUuid,
+ "modelName": "SERVICE_INSTANCE_NAME",
+ "modelVersion": "2.0",
+ "distributionStatus": "DISTRIBUTION_COMPLETE_OK",
+ "resourceVersion": "resourceVersion",
+ "modelDescription": "modelDescription"
+ },
+ }).as("expectLatestServiceModelUpgradeVersion")
+ }
+}
-
-function initVidMock(): void {
+function initVidMock(...args :any): void {
initGetToMenuInfo();
initCategoryParameter();
initFlags();
initAuditInfoVID();
initAuditInfoMSO();
+ mockLatestVersionForService(args[0]);
}
@@ -123,3 +141,5 @@ Cypress.Commands.add('initCategoryParameter', initCategoryParameter);
Cypress.Commands.add('initAuditInfoMSO', initAuditInfoMSO);
Cypress.Commands.add('initAuditInfoMSOALaCarte', initAuditInfoMSOALaCarte);
Cypress.Commands.add('initAsyncInstantiation', initAsyncInstantiation);
+Cypress.Commands.add('mockLatestVersionForService', mockLatestVersionForService);
+