-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vcd): add datacentre integration tests (#13751)
ref: MANAGER-15653 Signed-off-by: Paul Dickerson <[email protected]>
- Loading branch information
Showing
24 changed files
with
877 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './iam/iam.handler'; | ||
export * from './vcd-organization/vcd-organization.handler'; | ||
export * from './vcd-organization/vcd-datacentre-order.handler'; | ||
export * from './veeam-backup/veeam-backup.handler'; |
156 changes: 156 additions & 0 deletions
156
packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-catalog.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
import { TVcdCatalog } from '../../src/types/vcd-catalog.interface'; | ||
|
||
export const catalogProductList: TVcdCatalog = [ | ||
{ | ||
productName: 'pack-3264', | ||
mandatory: false, | ||
exclusive: false, | ||
family: 'host_order', | ||
productType: 'cloud_service', | ||
planCode: 'pack-3264', | ||
prices: [ | ||
{ | ||
priceInUcents: 0, | ||
pricingType: 'rental', | ||
maximumRepeat: 1, | ||
price: { currencyCode: 'EUR', text: '0.00 €', value: 0 }, | ||
minimumRepeat: 1, | ||
capacities: ['installation'], | ||
duration: 'P0D', | ||
maximumQuantity: null, | ||
interval: 0, | ||
description: 'Installation pricing', | ||
pricingMode: 'default', | ||
minimumQuantity: 1, | ||
}, | ||
{ | ||
pricingMode: 'default', | ||
minimumQuantity: 1, | ||
description: 'Installation pricing', | ||
interval: 1, | ||
maximumQuantity: null, | ||
duration: 'P1M', | ||
capacities: ['renew'], | ||
minimumRepeat: 1, | ||
price: { value: 80, text: '80.00 €', currencyCode: 'EUR' }, | ||
maximumRepeat: null, | ||
pricingType: 'rental', | ||
priceInUcents: 8_000_000_000, | ||
}, | ||
], | ||
}, | ||
{ | ||
productName: 'pack-1664', | ||
mandatory: false, | ||
exclusive: false, | ||
family: 'host_order', | ||
productType: 'cloud_service', | ||
planCode: 'pack-1664', | ||
prices: [ | ||
{ | ||
capacities: ['installation'], | ||
minimumRepeat: 1, | ||
duration: 'P0D', | ||
pricingType: 'rental', | ||
priceInUcents: 0, | ||
price: { text: '0.00 €', currencyCode: 'EUR', value: 0 }, | ||
maximumRepeat: 1, | ||
description: 'Installation pricing', | ||
minimumQuantity: 1, | ||
pricingMode: 'default', | ||
maximumQuantity: null, | ||
interval: 0, | ||
}, | ||
{ | ||
pricingMode: 'default', | ||
minimumQuantity: 1, | ||
description: 'Installation pricing', | ||
maximumQuantity: null, | ||
interval: 1, | ||
duration: 'P1M', | ||
capacities: ['renew'], | ||
minimumRepeat: 1, | ||
pricingType: 'rental', | ||
priceInUcents: 8_000_000_000, | ||
price: { text: '80.00 €', currencyCode: 'EUR', value: 80 }, | ||
maximumRepeat: null, | ||
}, | ||
], | ||
}, | ||
{ | ||
productType: 'cloud_service', | ||
planCode: 'pack-16128', | ||
prices: [ | ||
{ | ||
maximumQuantity: null, | ||
interval: 0, | ||
minimumQuantity: 1, | ||
pricingMode: 'default', | ||
description: 'Installation pricing', | ||
priceInUcents: 0, | ||
pricingType: 'rental', | ||
maximumRepeat: 1, | ||
price: { value: 0, text: '0.00 €', currencyCode: 'EUR' }, | ||
duration: 'P0D', | ||
minimumRepeat: 1, | ||
capacities: ['installation'], | ||
}, | ||
{ | ||
minimumQuantity: 1, | ||
pricingMode: 'default', | ||
description: 'Installation pricing', | ||
interval: 1, | ||
maximumQuantity: null, | ||
duration: 'P1M', | ||
minimumRepeat: 1, | ||
capacities: ['renew'], | ||
maximumRepeat: null, | ||
price: { value: 80, currencyCode: 'EUR', text: '80.00 €' }, | ||
priceInUcents: 8_000_000_000, | ||
pricingType: 'rental', | ||
}, | ||
], | ||
productName: 'pack-16128', | ||
mandatory: false, | ||
family: 'host_order', | ||
exclusive: false, | ||
}, | ||
{ | ||
prices: [ | ||
{ | ||
maximumQuantity: null, | ||
interval: 0, | ||
description: 'Installation pricing', | ||
minimumQuantity: 1, | ||
pricingMode: 'default', | ||
pricingType: 'rental', | ||
priceInUcents: 0, | ||
price: { value: 0, currencyCode: 'EUR', text: '0.00 €' }, | ||
maximumRepeat: 1, | ||
capacities: ['installation'], | ||
minimumRepeat: 1, | ||
duration: 'P0D', | ||
}, | ||
{ | ||
minimumRepeat: 1, | ||
capacities: ['renew'], | ||
duration: 'P1M', | ||
priceInUcents: 8_000_000_000, | ||
pricingType: 'rental', | ||
maximumRepeat: null, | ||
price: { value: 80, currencyCode: 'EUR', text: '80.00 €' }, | ||
description: 'Installation pricing', | ||
pricingMode: 'default', | ||
minimumQuantity: 1, | ||
maximumQuantity: null, | ||
interval: 1, | ||
}, | ||
], | ||
planCode: 'vcd-datastore-1000', | ||
productType: 'cloud_service', | ||
family: 'storage_order', | ||
exclusive: false, | ||
mandatory: false, | ||
productName: 'vcd-datastore-1000', | ||
}, | ||
]; |
43 changes: 43 additions & 0 deletions
43
...anager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-datacentre-order.handler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { IVdcOrderableResourceData } from '@/types/vcd-vdc-orderable-resource.interface'; | ||
import { Handler } from '../../../../../../playwright-helpers'; | ||
import { catalogProductList } from './vcd-catalog.mock'; | ||
import { orderableResourceData } from './vdc-orderable-resource.mock'; | ||
|
||
export type GetDatacentreOrderMocksParams = { | ||
isCatalogKO?: boolean; | ||
nbCatalogProduct?: number; | ||
isOrderableResourceKO?: boolean; | ||
nbOrderableResource?: number; | ||
}; | ||
|
||
export const getDatacentreOrderMocks = ({ | ||
isCatalogKO, | ||
nbCatalogProduct = Number.POSITIVE_INFINITY, | ||
isOrderableResourceKO, | ||
nbOrderableResource = Number.POSITIVE_INFINITY, | ||
}: GetDatacentreOrderMocksParams): Handler[] => { | ||
const selectedOrderableResource: IVdcOrderableResourceData = { | ||
compute: orderableResourceData.compute.slice(0, nbOrderableResource), | ||
storage: orderableResourceData.storage.slice(0, nbOrderableResource), | ||
}; | ||
|
||
return [ | ||
{ | ||
url: | ||
'/vmwareCloudDirector/organization/:id/virtualDataCenter/:id/orderableResource', | ||
response: isOrderableResourceKO | ||
? { message: 'OrderableResource error' } | ||
: selectedOrderableResource, | ||
api: 'v2', | ||
status: isOrderableResourceKO ? 500 : 200, | ||
}, | ||
{ | ||
url: '/order/cartServiceOption/vmwareCloudDirector/:id', | ||
response: isCatalogKO | ||
? { message: 'Catalog error' } | ||
: catalogProductList.slice(0, nbCatalogProduct), | ||
api: 'v6', | ||
status: isCatalogKO ? 500 : 200, | ||
}, | ||
]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.