From dcad829a8020c73c42718274f1caac030a53d562 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Fri, 6 Sep 2024 16:53:00 +0530 Subject: [PATCH] fix cypress for the Customzie Landing and EntityVersion page (#17744) --- .../ui/cypress/common/CustomizeLandingPageUtils.ts | 8 ++++++-- .../main/resources/ui/src/utils/EntityVersionUtils.tsx | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/CustomizeLandingPageUtils.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/CustomizeLandingPageUtils.ts index 9bb78f671082..c7c270e9140c 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/CustomizeLandingPageUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/CustomizeLandingPageUtils.ts @@ -55,14 +55,18 @@ export const navigateToCustomizeLandingPage = ({ `/api/v1/docStore/name/persona.${personaName}.Page.LandingPage`, 'getCustomPageData' ); - interceptURL('GET', `/api/v1/users/*?fields=follows%2Cowns`, 'getMyData'); + interceptURL( + 'GET', + '/api/v1/search/query?q=*%20AND%20followers:**', + 'getFollowersData' + ); cy.get( `[data-testid="persona-details-card-${personaName}"] [data-testid="customize-page-button"]` ).click(); verifyResponseStatusCode('@getCustomPageData', customPageDataResponse); - verifyResponseStatusCode('@getMyData', 200); + verifyResponseStatusCode('@getFollowersData', 200); }; export const saveLayout = () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx index 8606238f99f9..e67551d66224 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx @@ -176,8 +176,8 @@ export const getTextDiff = ( } if ( - newText.includes(imagePlaceholder) || - oldText.includes(imagePlaceholder) + newText?.includes(imagePlaceholder) || + oldText?.includes(imagePlaceholder) ) { return newText; }