From 2aea1012a83d81cf15310d2b5770a69f10ae0883 Mon Sep 17 00:00:00 2001 From: Eric <35898232+Eric-ciccotti@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:45:28 +0100 Subject: [PATCH] feat(pci-rancher): add additional guides links (#13595) ref: TAPC-675 Signed-off-by: Eric Ciccotti Co-authored-by: CDS Translator Agent --- .../onboarding/Messages_de_DE.json | 6 +- .../onboarding/Messages_en_GB.json | 6 +- .../onboarding/Messages_es_ES.json | 6 +- .../onboarding/Messages_fr_CA.json | 4 + .../onboarding/Messages_fr_FR.json | 4 + .../onboarding/Messages_it_IT.json | 6 +- .../onboarding/Messages_pl_PL.json | 6 +- .../onboarding/Messages_pt_PT.json | 6 +- .../src/hooks/useGuideLink/useGuideLink.tsx | 94 +++++++++++++++++++ .../src/pages/onboarding/Onboarding.page.tsx | 38 ++++++-- .../src/pages/onboarding/onboarding.test.tsx | 35 ++++++- 11 files changed, 190 insertions(+), 21 deletions(-) diff --git a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_de_DE.json b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_de_DE.json index aaacbf63db44..e00c535c6767 100644 --- a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_de_DE.json +++ b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_de_DE.json @@ -16,5 +16,9 @@ "guide3Description": "Wie Sie einen NAS über CIFS auf Windows Server mounten", "guide3Link": "https://help.ovhcloud.com/csm/de-public-cloud-storage-nas-cifs?id=kb_article_view&sysparm_article=KB0046663", "managedRancherServiceGettingStartedTitle": "Erste Schritte mit Managed Rancher Service", - "managedRancherServiceGettingStartedTitleDescription": "Wie Sie Managed Rancher Service bei OVHcloud verwenden" + "managedRancherServiceGettingStartedTitleDescription": "Wie Sie Managed Rancher Service bei OVHcloud verwenden", + "managedRancherServiceGettingStartedTitle2": "Managed Rancher Service erstellen, aktualisieren und darauf zugreifen", + "managedRancherServiceGettingStartedTitleDescription2": "Hier erfahren Sie, wie Sie einen Managed Rancher Service erstellen, aktualisieren und darauf zugreifen", + "managedRancherServiceGettingStartedTitle3": "Den Lebenszyklus von Managed Rancher Service verstehen", + "managedRancherServiceGettingStartedTitleDescription3": "Entdecken Sie den Lebenszyklus von Rancher-Versionen bei Managed Rancher Service" } diff --git a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_en_GB.json b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_en_GB.json index bf0f9cbe656f..0ac0e1eadb3d 100644 --- a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_en_GB.json +++ b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_en_GB.json @@ -16,5 +16,9 @@ "guide3Description": "Find out how to mount a NAS on Windows Server via CIFS", "guide3Link": "https://help.ovhcloud.com/csm/en-gb-public-cloud-storage-nas-cifs?id=kb_article_view&sysparm_article=KB0046664", "managedRancherServiceGettingStartedTitle": "Getting started with the Managed Rancher Service", - "managedRancherServiceGettingStartedTitleDescription": "Find out how to use the Managed Rancher Service on OVHcloud" + "managedRancherServiceGettingStartedTitleDescription": "Find out how to use the Managed Rancher Service on OVHcloud", + "managedRancherServiceGettingStartedTitle2": "Create, update and access a Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription2": "Find out how to create, update and access a Managed Rancher Service", + "managedRancherServiceGettingStartedTitle3": "Understanding the Managed Rancher Service lifecycle", + "managedRancherServiceGettingStartedTitleDescription3": "Discover the Rancher version lifecycle on the Managed Rancher Service" } diff --git a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_es_ES.json b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_es_ES.json index 6f3c6197ac15..162a66e839d9 100644 --- a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_es_ES.json +++ b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_es_ES.json @@ -16,5 +16,9 @@ "guide3Description": "Cómo montar un NAS en Windows Server a través del protocolo CIFS", "guide3Link": "https://help.ovhcloud.com/csm/es-es-public-cloud-storage-nas-cifs?id=kb_article_view&sysparm_article=KB0046668", "managedRancherServiceGettingStartedTitle": "Empezar con Managed Rancher Service", - "managedRancherServiceGettingStartedTitleDescription": "Descubra cómo utilizar Managed Rancher Service en OVHcloud" + "managedRancherServiceGettingStartedTitleDescription": "Descubra cómo utilizar Managed Rancher Service en OVHcloud", + "managedRancherServiceGettingStartedTitle2": "Crear, actualizar y acceder a un Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription2": "Cómo crear, actualizar y acceder a un Managed Rancher Service", + "managedRancherServiceGettingStartedTitle3": "Descripción del Ciclo de Vida de Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription3": "Descubra el ciclo de vida de las versiones de Rancher en Managed Rancher Service" } diff --git a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_fr_CA.json b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_fr_CA.json index 1b9306dde116..92cdc26080c6 100644 --- a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_fr_CA.json +++ b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_fr_CA.json @@ -8,6 +8,10 @@ "guideCategory": "Tutoriel", "managedRancherServiceGettingStartedTitle": "Démarrer avec Managed Rancher Service", "managedRancherServiceGettingStartedTitleDescription": "Découvrez comment utiliser Managed Rancher Service sur OVHcloud", + "managedRancherServiceGettingStartedTitle2": "Créer, mettre à jour et accéder à un Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription2": "Découvrez comment créer, mettre à jour, et accéder à un Managed Rancher Service", + "managedRancherServiceGettingStartedTitle3": "Comprendre le cycle de vie de Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription3": "Découvrez le cycle de vie des versions de Rancher sur Managed Rancher Service", "guide2Title": "Monter votre NAS via un partage NFS", "guide2Description": "Découvrez comment monter un NAS via un partage NFS", "guide3Title": "Monter votre NAS sur Windows Server via CIFS", diff --git a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_fr_FR.json b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_fr_FR.json index 1b9306dde116..92cdc26080c6 100644 --- a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_fr_FR.json +++ b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_fr_FR.json @@ -8,6 +8,10 @@ "guideCategory": "Tutoriel", "managedRancherServiceGettingStartedTitle": "Démarrer avec Managed Rancher Service", "managedRancherServiceGettingStartedTitleDescription": "Découvrez comment utiliser Managed Rancher Service sur OVHcloud", + "managedRancherServiceGettingStartedTitle2": "Créer, mettre à jour et accéder à un Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription2": "Découvrez comment créer, mettre à jour, et accéder à un Managed Rancher Service", + "managedRancherServiceGettingStartedTitle3": "Comprendre le cycle de vie de Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription3": "Découvrez le cycle de vie des versions de Rancher sur Managed Rancher Service", "guide2Title": "Monter votre NAS via un partage NFS", "guide2Description": "Découvrez comment monter un NAS via un partage NFS", "guide3Title": "Monter votre NAS sur Windows Server via CIFS", diff --git a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_it_IT.json b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_it_IT.json index 153ecfcbb6a8..b35bfb1e28d8 100644 --- a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_it_IT.json +++ b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_it_IT.json @@ -16,5 +16,9 @@ "guide3Description": "Come effettuare il mount di un NAS su Windows Server tramite il protocollo CIFS", "guide3Link": "https://help.ovhcloud.com/csm/it-public-cloud-storage-nas-cifs?id=kb_article_view&sysparm_article=KB0046671", "managedRancherServiceGettingStartedTitle": "Iniziare a utilizzare Managed Rancher Service", - "managedRancherServiceGettingStartedTitleDescription": "Scopri come utilizzare Managed Rancher Service in OVHcloud" + "managedRancherServiceGettingStartedTitleDescription": "Scopri come utilizzare Managed Rancher Service in OVHcloud", + "managedRancherServiceGettingStartedTitle2": "Creare, aggiornare e accedere a un Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription2": "Scopri come creare, aggiornare e accedere a un Managed Rancher Service", + "managedRancherServiceGettingStartedTitle3": "Comprendere il ciclo di vita del servizio Managed Rancher", + "managedRancherServiceGettingStartedTitleDescription3": "Scopri il ciclo di vita delle versioni di Rancher sul servizio Managed Rancher" } diff --git a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_pl_PL.json b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_pl_PL.json index 2185a14bc928..dbc808757643 100644 --- a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_pl_PL.json +++ b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_pl_PL.json @@ -16,5 +16,9 @@ "guide3Description": "Dowiedz się, jak zamontować NAS na serwerze Windows Server przy użyciu protokołu CIFS", "guide3Link": "https://help.ovhcloud.com/csm/pl-public-cloud-storage-nas-cifs?id=kb_article_view&sysparm_article=KB0046679", "managedRancherServiceGettingStartedTitle": "Zacznij korzystać z Managed Rancher Service", - "managedRancherServiceGettingStartedTitleDescription": "Dowiedz się, jak korzystać z Managed Rancher Service od OVHcloud" + "managedRancherServiceGettingStartedTitleDescription": "Dowiedz się, jak korzystać z Managed Rancher Service od OVHcloud", + "managedRancherServiceGettingStartedTitle2": "Tworzenie, aktualizowanie i uzyskiwanie dostępu do Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription2": "Dowiedz się, jak tworzyć, aktualizować i uzyskiwać dostęp do Managed Rancher Service", + "managedRancherServiceGettingStartedTitle3": "Zrozum cykl życia Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription3": "Sprawdź cykl życia wersji Rancher w Managed Rancher Service" } diff --git a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_pt_PT.json b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_pt_PT.json index 4d92da24b8f2..16bcab063664 100644 --- a/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_pt_PT.json +++ b/packages/manager/apps/pci-rancher/public/translations/onboarding/Messages_pt_PT.json @@ -16,5 +16,9 @@ "guide3Description": "Saiba como montar um NAS no Windows Server através do protocolo CIFS", "guide3Link": "https://help.ovhcloud.com/csm/pt-public-cloud-storage-nas-cifs?id=kb_article_view&sysparm_article=KB0046676", "managedRancherServiceGettingStartedTitle": "Começar com o Managed Rancher Service", - "managedRancherServiceGettingStartedTitleDescription": "Saiba como utilizar o Managed Rancher Service na OVHcloud" + "managedRancherServiceGettingStartedTitleDescription": "Saiba como utilizar o Managed Rancher Service na OVHcloud", + "managedRancherServiceGettingStartedTitle2": "Criar, atualizar e aceder a um Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription2": "Saiba como criar, atualizar e aceder a um Managed Rancher Service", + "managedRancherServiceGettingStartedTitle3": "Compreender o ciclo de vida do Managed Rancher Service", + "managedRancherServiceGettingStartedTitleDescription3": "Descubra o ciclo de vida das versões do Rancher no Managed Rancher Service" } diff --git a/packages/manager/apps/pci-rancher/src/hooks/useGuideLink/useGuideLink.tsx b/packages/manager/apps/pci-rancher/src/hooks/useGuideLink/useGuideLink.tsx index 5ba3fb3ade25..a50ffa89565d 100644 --- a/packages/manager/apps/pci-rancher/src/hooks/useGuideLink/useGuideLink.tsx +++ b/packages/manager/apps/pci-rancher/src/hooks/useGuideLink/useGuideLink.tsx @@ -52,6 +52,100 @@ const GUIDE_LIST: { [guideName: string]: Partial } = { WS: 'https://help.ovhcloud.com/csm/es-public-cloud-managed-rancher-service-getting-started?id=kb_article_view&sysparm_article=KB0061900', }, + MANAGED_RANCHER_SERVICE_CREATION: { + DEFAULT: + 'https://help.ovhcloud.com/csm/en-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064191', + ASIA: + 'https://help.ovhcloud.com/csm/asia-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064184', + AU: + 'https://help.ovhcloud.com/csm/en-au-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064190', + CA: + 'https://help.ovhcloud.com/csm/en-ca-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064197', + DE: + 'https://help.ovhcloud.com/csm/de-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064194', + ES: + 'https://help.ovhcloud.com/csm/es-es-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064193', + EU: + 'https://help.ovhcloud.com/csm/en-ie-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064183', + FR: + 'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064198', + GB: + 'https://help.ovhcloud.com/csm/en-gb-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064189', + IE: + 'https://help.ovhcloud.com/csm/en-ie-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064183', + IN: + 'https://help.ovhcloud.com/csm/asia-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064184', + IT: + 'https://help.ovhcloud.com/csm/it-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064195', + MA: + 'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064198', + NL: + 'https://help.ovhcloud.com/csm/en-nl-documentation-public-cloud?id=kb_browse_cat&kb_id=574a8325551974502d4c6e78b7421938', + PL: + 'https://help.ovhcloud.com/csm/pl-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064187', + PT: + 'https://help.ovhcloud.com/csm/pt-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064196', + QC: + 'https://help.ovhcloud.com/csm/fr-ca-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064186', + SG: + 'https://help.ovhcloud.com/csm/en-sg-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064192', + SN: + 'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064198', + TN: + 'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064198', + US: 'https://us.ovhcloud.com/support', + WE: + 'https://help.ovhcloud.com/csm/en-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064191', + WS: + 'https://help.ovhcloud.com/csm/es-public-cloud-managed-rancher-service-creation?id=kb_article_view&sysparm_article=KB0064185', + }, + MANAGED_RANCHER_SERVICE_LIFECYCLE_POLICY: { + DEFAULT: + 'https://help.ovhcloud.com/csm/en-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064598', + ASIA: + 'https://help.ovhcloud.com/csm/asia-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064602', + AU: + 'https://help.ovhcloud.com/csm/en-au-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064611', + CA: + 'https://help.ovhcloud.com/csm/en-ca-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064609', + DE: + 'https://help.ovhcloud.com/csm/de-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064600', + ES: + 'https://help.ovhcloud.com/csm/es-es-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064605', + EU: + 'https://help.ovhcloud.com/csm/en-ie-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064606', + FR: + 'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064608', + GB: + 'https://help.ovhcloud.com/csm/en-gb-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064607', + IE: + 'https://help.ovhcloud.com/csm/en-ie-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064606', + IN: + 'https://help.ovhcloud.com/csm/asia-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064602', + IT: + 'https://help.ovhcloud.com/csm/it-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064612', + MA: + 'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064608', + NL: + 'https://help.ovhcloud.com/csm/en-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064598', // DEFAULT en attendant mieux + PL: + 'https://help.ovhcloud.com/csm/pl-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064610', + PT: + 'https://help.ovhcloud.com/csm/pt-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064604', + QC: + 'https://help.ovhcloud.com/csm/fr-ca-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064599', + SG: + 'https://help.ovhcloud.com/csm/en-sg-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064603', + SN: + 'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064608', + TN: + 'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064608', + US: 'https://us.ovhcloud.com/support', + WE: + 'https://help.ovhcloud.com/csm/en-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064598', + WS: + 'https://help.ovhcloud.com/csm/es-public-cloud-managed-rancher-service-lifecycle-policy?id=kb_article_view&sysparm_article=KB0064601', + }, }; type GetGuideLinkProps = { diff --git a/packages/manager/apps/pci-rancher/src/pages/onboarding/Onboarding.page.tsx b/packages/manager/apps/pci-rancher/src/pages/onboarding/Onboarding.page.tsx index 7ae266e42fe6..1ada8e429fa3 100644 --- a/packages/manager/apps/pci-rancher/src/pages/onboarding/Onboarding.page.tsx +++ b/packages/manager/apps/pci-rancher/src/pages/onboarding/Onboarding.page.tsx @@ -30,21 +30,39 @@ export default function Onboarding() { navigate(getCreateRancherUrl(projectId)); }; - const tileList = [ + const tileData = [ { id: 1, - texts: { - title: t('managedRancherServiceGettingStartedTitle'), - description: t('managedRancherServiceGettingStartedTitleDescription'), - category: t('guideCategory'), - }, - href: link?.MANAGED_RANCHER_SERVICE_GETTING_STARTED as string, - - isExternalHref: true, - hoverable: true, + titleKey: 'managedRancherServiceGettingStartedTitle', + descriptionKey: 'managedRancherServiceGettingStartedTitleDescription', + hrefKey: 'MANAGED_RANCHER_SERVICE_GETTING_STARTED', + }, + { + id: 2, + titleKey: 'managedRancherServiceGettingStartedTitle2', + descriptionKey: 'managedRancherServiceGettingStartedTitleDescription2', + hrefKey: 'MANAGED_RANCHER_SERVICE_CREATION', + }, + { + id: 3, + titleKey: 'managedRancherServiceGettingStartedTitle3', + descriptionKey: 'managedRancherServiceGettingStartedTitleDescription3', + hrefKey: 'MANAGED_RANCHER_SERVICE_LIFECYCLE_POLICY', }, ]; + const tileList = tileData.map((item) => ({ + ...item, + texts: { + title: t(item.titleKey), + description: t(item.descriptionKey), + category: t('guideCategory'), + }, + href: link?.[item.hrefKey] as string, + isExternalHref: true, + hoverable: true, + })); + return ( diff --git a/packages/manager/apps/pci-rancher/src/pages/onboarding/onboarding.test.tsx b/packages/manager/apps/pci-rancher/src/pages/onboarding/onboarding.test.tsx index 45cc1f5a76af..db463a778d49 100644 --- a/packages/manager/apps/pci-rancher/src/pages/onboarding/onboarding.test.tsx +++ b/packages/manager/apps/pci-rancher/src/pages/onboarding/onboarding.test.tsx @@ -27,6 +27,8 @@ jest.mock('@ovh-ux/manager-react-shell-client', () => ({ jest.mock('@/hooks/useGuideLink/useGuideLink', () => ({ useGuideUtils: jest.fn(() => ({ MANAGED_RANCHER_SERVICE_GETTING_STARTED: 'https://example.com/guide1', + MANAGED_RANCHER_SERVICE_CREATION: 'https://example.com/guide2', + MANAGED_RANCHER_SERVICE_LIFECYCLE_POLICY: 'https://example.com/guide3', })), })); @@ -58,6 +60,12 @@ describe('Onboarding', () => { it('renders the guide tiles correctly', async () => { const screen = await setupSpecTest(); + const tileList = [ + { id: 1, href: 'https://example.com/guide1' }, + { id: 2, href: 'https://example.com/guide2' }, + { id: 3, href: 'https://example.com/guide3' }, + ]; + const guideTitle = screen.getByText( onboardingTranslation.managedRancherServiceGettingStartedTitle, ); @@ -68,15 +76,32 @@ describe('Onboarding', () => { expect(guideTitle).toBeInTheDocument(); expect(guideDescription).toBeInTheDocument(); - const card = screen.getByTestId('tileCard'); - expect(card).toHaveAttribute('href', 'https://example.com/guide1'); + const cards = screen.getAllByTestId('tileCard'); + cards.forEach((card, index) => { + expect(card).toHaveAttribute('href', tileList[index].href); + }); }); it('uses the guide link utility correctly', async () => { const guideUtils = useGuideUtils(); - expect(guideUtils.MANAGED_RANCHER_SERVICE_GETTING_STARTED).toBe( - 'https://example.com/guide1', - ); + const expectedResults = [ + { + key: 'MANAGED_RANCHER_SERVICE_GETTING_STARTED', + expectedValue: 'https://example.com/guide1', + }, + { + key: 'MANAGED_RANCHER_SERVICE_CREATION', + expectedValue: 'https://example.com/guide2', + }, + { + key: 'MANAGED_RANCHER_SERVICE_LIFECYCLE_POLICY', + expectedValue: 'https://example.com/guide3', + }, + ]; + + expectedResults.forEach((testCase) => { + expect(guideUtils[testCase.key]).toBe(testCase.expectedValue); + }); }); });