diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/iam/iam.mock.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/iam/iam.mock.ts
index 9c7b36f89c6a..2ef5404743a0 100644
--- a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/iam/iam.mock.ts
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/iam/iam.mock.ts
@@ -1,4 +1,5 @@
import { IamCheckResponse } from '@ovh-ux/manager-react-components';
+import { datacentreList } from '../vcd-organization/vcd-datacentre.mock';
import { organizationList } from '../vcd-organization/vcd-organization.mock';
import { iamActions } from '@/utils/iam.constants';
@@ -19,4 +20,11 @@ export const resourceList: IamCheckResponse[] = [
],
unauthorizedActions: [],
},
+ {
+ urn: datacentreList[0].iam.urn,
+ authorizedActions: [
+ iamActions.vmwareCloudDirectorApiovhOrganizationVirtualDataCenterEdit,
+ ],
+ unauthorizedActions: [],
+ },
];
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/index.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/index.ts
index 05a214fbbb99..3d40b59a8819 100644
--- a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/index.ts
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/index.ts
@@ -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';
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-catalog.mock.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-catalog.mock.ts
new file mode 100644
index 000000000000..8d03032dd813
--- /dev/null
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-catalog.mock.ts
@@ -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',
+ },
+];
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-datacentre-order.handler.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-datacentre-order.handler.ts
new file mode 100644
index 000000000000..ac2af6c75a35
--- /dev/null
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-datacentre-order.handler.ts
@@ -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,
+ },
+ ];
+};
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-datacentre.mock.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-datacentre.mock.ts
index f3830048da4b..32446b83efd0 100644
--- a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-datacentre.mock.ts
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-datacentre.mock.ts
@@ -6,8 +6,7 @@ export const datacentreList: IVcdDatacentre[] = [
resourceStatus: 'READY',
currentState: {
commercialRange: 'STANDARD',
- description:
- 'Pour vous proposer une description adaptée, pourriez-vous me donner plus de détails sur votre service ? Cela me permettra de créer une description précise et impactante qui tient dans la limite des 255 caractères.',
+ description: 'VDC Description',
ipQuota: 10,
memoryQuota: 64,
name: 'vdc-eu-central-waw-adc311b5-0c0b-4071-b48f-b20813868bcf',
@@ -18,8 +17,7 @@ export const datacentreList: IVcdDatacentre[] = [
},
currentTasks: [],
targetSpec: {
- description:
- 'Pour vous proposer une description adaptée, pourriez-vous me donner plus de détails sur votre service ? Cela me permettra de créer une description précise et impactante qui tient dans la limite des 255 caractères.',
+ description: 'VDC Description targetSpec',
vCPUSpeed: 3,
},
updatedAt: '2024-09-23T13:53:49Z',
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-organization.handler.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-organization.handler.ts
index f7946ad71e6a..68da1e813be3 100644
--- a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-organization.handler.ts
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-organization.handler.ts
@@ -2,6 +2,8 @@ import { PathParams } from 'msw';
import { Handler } from '../../../../../../playwright-helpers';
import { organizationList } from './vcd-organization.mock';
import { datacentreList } from './vcd-datacentre.mock';
+import { computeList } from './vdc-compute.mock';
+import { storageList } from './vdc-storage.mock';
export type GetOrganizationMocksParams = {
isOrganizationKo?: boolean;
@@ -9,38 +11,83 @@ export type GetOrganizationMocksParams = {
nbOrganization?: number;
allOrgsBackedUp?: boolean;
isDatacentresKo?: boolean;
+ isDatacentreUpdateKo?: boolean;
nbDatacentres?: number;
+ isComputeKO?: boolean;
+ nbCompute?: number;
+ isStorageKO?: boolean;
+ nbStorage?: number;
};
const findOrganizationById = (params: PathParams) =>
organizationList.find(({ id }) => id === params.id);
+const findDatacentreById = (params: PathParams) =>
+ datacentreList.find(({ id }) => id === params.id);
+
export const getOrganizationMocks = ({
isOrganizationKo,
isOrganizationUpdateKo,
nbOrganization = Number.POSITIVE_INFINITY,
allOrgsBackedUp,
isDatacentresKo,
+ isDatacentreUpdateKo,
nbDatacentres = Number.POSITIVE_INFINITY,
+ isComputeKO,
+ nbCompute = Number.POSITIVE_INFINITY,
+ isStorageKO,
+ nbStorage = Number.POSITIVE_INFINITY,
}: GetOrganizationMocksParams): Handler[] => {
const nb = allOrgsBackedUp ? 1 : nbOrganization;
return [
+ {
+ url:
+ '/vmwareCloudDirector/organization/:id/virtualDataCenter/:id/storage',
+ response: isStorageKO
+ ? { message: 'Storage error' }
+ : storageList.slice(0, nbStorage),
+ api: 'v2',
+ status: isStorageKO ? 500 : 200,
+ },
+ {
+ url:
+ '/vmwareCloudDirector/organization/:id/virtualDataCenter/:id/compute',
+ response: isComputeKO
+ ? { message: 'Compute error' }
+ : computeList.slice(0, nbCompute),
+ api: 'v2',
+ status: isComputeKO ? 500 : 200,
+ },
{
url: '/vmwareCloudDirector/organization/:id/virtualDataCenter',
response: isDatacentresKo
- ? {
- message: 'Datacentres error',
- }
+ ? { message: 'Datacentres error' }
: datacentreList.slice(0, nbDatacentres),
api: 'v2',
status: isDatacentresKo ? 500 : 200,
},
+ {
+ url: '/vmwareCloudDirector/organization/:id/virtualDataCenter/:id',
+ response: (_: unknown, params: PathParams) =>
+ isDatacentresKo
+ ? { message: 'Datacentre error' }
+ : findDatacentreById(params),
+ api: 'v2',
+ status: isDatacentresKo ? 500 : 200,
+ },
+ {
+ url: '/vmwareCloudDirector/organization/:id/virtualDataCenter/:id',
+ response: isDatacentreUpdateKo
+ ? { message: 'Datacentre update error' }
+ : {},
+ method: 'put',
+ api: 'v2',
+ status: isDatacentreUpdateKo ? 500 : 200,
+ },
{
url: '/vmwareCloudDirector/organization/:id',
response: isOrganizationUpdateKo
- ? {
- message: 'Organization update error',
- }
+ ? { message: 'Organization update error' }
: {},
method: 'put',
api: 'v2',
@@ -50,9 +97,7 @@ export const getOrganizationMocks = ({
url: '/vmwareCloudDirector/organization/:id',
response: (_: unknown, params: PathParams) =>
isOrganizationKo
- ? {
- message: 'Organization error',
- }
+ ? { message: 'Organization error' }
: findOrganizationById(params),
api: 'v2',
status: isOrganizationKo ? 500 : 200,
@@ -60,9 +105,7 @@ export const getOrganizationMocks = ({
{
url: '/vmwareCloudDirector/organization',
response: isOrganizationKo
- ? {
- message: 'Organization error',
- }
+ ? { message: 'Organization error' }
: organizationList.slice(0, nb),
status: isOrganizationKo ? 500 : 200,
api: 'v2',
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-organization.mock.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-organization.mock.ts
index 963b0a20aedf..bb0f3dc62c8c 100644
--- a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-organization.mock.ts
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vcd-organization.mock.ts
@@ -24,8 +24,8 @@ export const organizationList: IVcdOrganization[] = [
id: '6cfa2c69-c62c-4853-80ee-c9682e6727f0',
resourceStatus: 'UPDATING',
targetSpec: {
- description: 'Company production VCD Organization',
- fullName: 'Company VCD',
+ description: 'Company VCD Organization targetSpec',
+ fullName: 'Company VCD targetSpec',
},
updatedAt: '2024-06-14T09:21:21.943Z',
iam: {
@@ -48,8 +48,8 @@ export const organizationList: IVcdOrganization[] = [
id: '61ebdcec-0623-4a61-834f-a1719cd475b4',
resourceStatus: 'READY',
targetSpec: {
- description: 'My demo VCD Organization',
- fullName: 'Demo VCD',
+ description: 'My demo VCD Organization targetSpec',
+ fullName: 'Demo VCD targetSpec',
},
updatedAt: '2024-06-14T09:21:21.943Z',
iam: {
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-compute.mock.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-compute.mock.ts
new file mode 100644
index 000000000000..a0a42ed9cfb2
--- /dev/null
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-compute.mock.ts
@@ -0,0 +1,28 @@
+import IVcdCompute from '../../src/types/vcd-compute.interface';
+
+export const computeList: IVcdCompute[] = [
+ {
+ id: 'f578c64f-ebec-4c19-a006-c96b1c7c1b95',
+ resourceStatus: 'READY',
+ currentState: {
+ billingType: 'MONTHLY',
+ memoryQuota: 32,
+ name: 'vhost-4-32',
+ profile: 'vhost-4-32',
+ vCPUCount: 8,
+ },
+ currentTasks: [],
+ },
+ {
+ id: '6873cbc3-d158-4cdc-8d37-b2d8dded3457',
+ resourceStatus: 'READY',
+ currentState: {
+ billingType: 'MONTHLY',
+ memoryQuota: 32,
+ name: 'vhost-4-32',
+ profile: 'vhost-4-32',
+ vCPUCount: 8,
+ },
+ currentTasks: [],
+ },
+];
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-orderable-resource.mock.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-orderable-resource.mock.ts
new file mode 100644
index 000000000000..a62528086349
--- /dev/null
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-orderable-resource.mock.ts
@@ -0,0 +1,35 @@
+import { IVdcOrderableResourceData } from '../../src/types/vcd-vdc-orderable-resource.interface';
+
+export const orderableResourceData: IVdcOrderableResourceData = {
+ compute: [
+ {
+ memoryQuota: 64,
+ name: 'vhost-32-64',
+ profile: 'pack-3264',
+ vCPUCount: 32,
+ vCPUSpeed: 3,
+ },
+ {
+ memoryQuota: 64,
+ name: 'vhost-16-64',
+ profile: 'pack-1664',
+ vCPUCount: 16,
+ vCPUSpeed: 3,
+ },
+ {
+ memoryQuota: 128,
+ name: 'vhost-16-128',
+ profile: 'pack-16128',
+ vCPUCount: 16,
+ vCPUSpeed: 3,
+ },
+ ],
+ storage: [
+ {
+ capacity: 1000,
+ name: 'vcd-datastore-1000',
+ profile: 'vcd-datastore-1000',
+ type: 'storage',
+ },
+ ],
+};
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-storage.mock.ts b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-storage.mock.ts
new file mode 100644
index 000000000000..e3538f33c932
--- /dev/null
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/mocks/vcd-organization/vdc-storage.mock.ts
@@ -0,0 +1,28 @@
+import IVcdStorage from '../../src/types/vcd-storage.interface';
+
+export const storageList: IVcdStorage[] = [
+ {
+ id: 'fccce864-e1d5-4ab8-ad6a-79ecd295f420',
+ resourceStatus: 'READY',
+ currentState: {
+ billingType: 'MONTHLY',
+ capacity: 300,
+ name: 'vcd-datastore-300',
+ profile: 'vcd-datastore-300',
+ type: 'DEFAULT',
+ },
+ currentTasks: [],
+ },
+ {
+ id: 'b683b2d1-2387-46da-8e1b-76ebbee0dba9',
+ resourceStatus: 'READY',
+ currentState: {
+ billingType: 'MONTHLY',
+ capacity: 300,
+ name: 'vcd-datastore-300',
+ profile: 'vcd-datastore-300',
+ type: 'DEFAULT',
+ },
+ currentTasks: [],
+ },
+];
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/DatacentreDashboard.spec.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/DatacentreDashboard.spec.tsx
new file mode 100644
index 000000000000..d0fa0db2482e
--- /dev/null
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/DatacentreDashboard.spec.tsx
@@ -0,0 +1,22 @@
+import { checkTextVisibility, labels, renderTest } from '../../../test-utils';
+import { datacentreList } from '../../../../mocks/vcd-organization/vcd-datacentre.mock';
+import { organizationList } from '../../../../mocks/vcd-organization/vcd-organization.mock';
+
+describe('Datacentre Dashboard Page', () => {
+ it('display the datacentre dashboard page', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}`,
+ });
+
+ await checkTextVisibility(labels.datacentres.managed_vcd_vdc_vcpu_count);
+ });
+
+ it('display an error', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}`,
+ isDatacentresKo: true,
+ });
+
+ await checkTextVisibility('Datacentre error');
+ });
+});
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/compute-order/DatacentreComputeOrder.spec.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/compute-order/DatacentreComputeOrder.spec.tsx
new file mode 100644
index 000000000000..22e78b6a5ccc
--- /dev/null
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/compute-order/DatacentreComputeOrder.spec.tsx
@@ -0,0 +1,59 @@
+import { screen, waitFor } from '@testing-library/dom';
+import userEvent from '@testing-library/user-event';
+import {
+ checkTextVisibility,
+ labels,
+ renderTest,
+} from '../../../../test-utils';
+import { datacentreList } from '../../../../../mocks/vcd-organization/vcd-datacentre.mock';
+import { organizationList } from '../../../../../mocks/vcd-organization/vcd-organization.mock';
+
+const orderCTA = labels.datacentresCompute.managed_vcd_vdc_compute_order_cta;
+const orderTitle = orderCTA;
+const orderError = labels.datacentresOrder.managed_vcd_vdc_order_unavailable;
+
+describe('Datacentre Compute Order Page', () => {
+ it('access and display compute order page', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}/compute`,
+ });
+
+ await checkTextVisibility(orderCTA);
+ const orderButton = screen.getByText(orderCTA);
+ await waitFor(() => userEvent.click(orderButton));
+
+ await checkTextVisibility(orderTitle);
+ });
+
+ it('display an error if orderableResource service is KO', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}/compute/order`,
+ isOrderableResourceKO: true,
+ });
+ await checkTextVisibility(orderError);
+ });
+
+ it('display an error if there is no orderableResource', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}/compute/order`,
+ nbOrderableResource: 0,
+ });
+ await checkTextVisibility(orderError);
+ });
+
+ it('display an error if catalog service is KO', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}/compute/order`,
+ isCatalogKO: true,
+ });
+ await checkTextVisibility(orderError);
+ });
+
+ it('display an error if there is no catalog products', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}/compute/order`,
+ nbCatalogProduct: 0,
+ });
+ await checkTextVisibility(orderError);
+ });
+});
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/compute/DatacentreCompute.spec.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/compute/DatacentreCompute.spec.tsx
new file mode 100644
index 000000000000..e24d71690f2a
--- /dev/null
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/compute/DatacentreCompute.spec.tsx
@@ -0,0 +1,40 @@
+import { screen, waitFor } from '@testing-library/dom';
+import userEvent from '@testing-library/user-event';
+import {
+ checkTextVisibility,
+ DEFAULT_LISTING_ERROR,
+ labels,
+ renderTest,
+} from '../../../../test-utils';
+import { datacentreList } from '../../../../../mocks/vcd-organization/vcd-datacentre.mock';
+import { organizationList } from '../../../../../mocks/vcd-organization/vcd-organization.mock';
+import { COMPUTE_TITLE } from '../DatacentreDashboard.constant';
+import { VHOSTS_TITLE } from '../compute/DatacentreCompute.constants';
+
+describe('Datacentre Compute Listing Page', () => {
+ it('access and display compute listing page', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}`,
+ });
+
+ // access compute tab
+ await checkTextVisibility(COMPUTE_TITLE);
+ const tab = screen.getByText(COMPUTE_TITLE);
+ await waitFor(() => userEvent.click(tab));
+
+ // check page title & CTA
+ await checkTextVisibility(VHOSTS_TITLE);
+ await checkTextVisibility(
+ labels.datacentresCompute.managed_vcd_vdc_compute_order_cta,
+ );
+ });
+
+ it('display an error', async () => {
+ await renderTest({
+ initialRoute: `/${organizationList[0].id}/datacentres/${datacentreList[0].id}/compute`,
+ isComputeKO: true,
+ });
+
+ await checkTextVisibility(DEFAULT_LISTING_ERROR);
+ });
+});
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/general-informations/DatacentreGeneralInformation.page.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/general-informations/DatacentreGeneralInformation.page.tsx
index 6b019d6829ee..ddf7fceeb3fe 100644
--- a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/general-informations/DatacentreGeneralInformation.page.tsx
+++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/general-informations/DatacentreGeneralInformation.page.tsx
@@ -4,18 +4,28 @@ import DatacentreGenerationInformationTile from '@/components/tiles/datacentre-g
import useManagedVcdOrganization from '@/data/hooks/useManagedVcdOrganization';
import { useManagedVcdDatacentre } from '@/data/hooks/useManagedVcdDatacentres';
import Loading from '@/components/loading/Loading.component';
+import Errors from '@/components/error/Error.component';
export default function DatacentresGeneralInformationPage() {
const { id, vdcId } = useParams();
- const { data: vcdOrganization, isLoading } = useManagedVcdOrganization({
+ const {
+ data: vcdOrganization,
+ isLoading: isLoadingVcd,
+ error: vcdError,
+ } = useManagedVcdOrganization({
id,
});
const {
data: vcdDatacentre,
- isLoading: isLoadingVdc,
+ isLoading: isLoadingDatacentre,
+ error: datacentreError,
} = useManagedVcdDatacentre(id, vdcId);
- if (isLoading || isLoadingVdc) {
+ if (vcdError || datacentreError) {
+ return