From 4f9fc671dcea03cbb22b7c0e02e29bdf88ba955f Mon Sep 17 00:00:00 2001 From: david-leifker <114954101+david-leifker@users.noreply.github.com> Date: Tue, 1 Aug 2023 19:59:30 -0500 Subject: [PATCH] fix(test): increase siblings.js test stability (#8542) --- datahub-web-react/src/app/lineage/LineageEntityNode.tsx | 9 ++++++--- .../tests/cypress/cypress/e2e/siblings/siblings.js | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/datahub-web-react/src/app/lineage/LineageEntityNode.tsx b/datahub-web-react/src/app/lineage/LineageEntityNode.tsx index 5b39d6aaf19c3..4526e3a225ce2 100644 --- a/datahub-web-react/src/app/lineage/LineageEntityNode.tsx +++ b/datahub-web-react/src/app/lineage/LineageEntityNode.tsx @@ -132,6 +132,10 @@ export default function LineageEntityNode({ areColumnsCollapsed, ); + const entityName = + capitalizeFirstLetterOnly(node.data.subtype) || + (node.data.type && entityRegistry.getEntityName(node.data.type)); + return ( {unexploredHiddenChildren && (isHovered || isSelected) ? ( @@ -335,9 +339,8 @@ export default function LineageEntityNode({ {' '} |{' '} - - {capitalizeFirstLetterOnly(node.data.subtype) || - (node.data.type && entityRegistry.getEntityName(node.data.type))} + + {entityName} {expandTitles ? ( diff --git a/smoke-test/tests/cypress/cypress/e2e/siblings/siblings.js b/smoke-test/tests/cypress/cypress/e2e/siblings/siblings.js index b7d48703992e2..00de08e77a185 100644 --- a/smoke-test/tests/cypress/cypress/e2e/siblings/siblings.js +++ b/smoke-test/tests/cypress/cypress/e2e/siblings/siblings.js @@ -113,9 +113,11 @@ describe('siblings', () => { cy.clickOptionWithTestId('compress-lineage-toggle'); // check the subtypes - cy.get('text:contains(View)').should('have.length', 2); - cy.get('text:contains(Table)').should('have.length', 0); - cy.get('text:contains(Seed)').should('have.length', 1); + cy.get('[data-testid="Seed"]').should('have.length', 1); + // center counts twice since we secretely render two center nodes, plus the downstream bigquery + cy.get('[data-testid="View"]').should('have.length', 3); + cy.get('[data-testid="Table"]').should('have.length', 0); + // check the names cy.get('text:contains(raw_orders)').should('have.length', 1);