Skip to content

Commit 4f9fc67

Browse files
fix(test): increase siblings.js test stability (#8542)
1 parent e380f7d commit 4f9fc67

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

datahub-web-react/src/app/lineage/LineageEntityNode.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export default function LineageEntityNode({
132132
areColumnsCollapsed,
133133
);
134134

135+
const entityName =
136+
capitalizeFirstLetterOnly(node.data.subtype) ||
137+
(node.data.type && entityRegistry.getEntityName(node.data.type));
138+
135139
return (
136140
<PointerGroup data-testid={`node-${node.data.urn}-${direction}`} top={node.x} left={node.y}>
137141
{unexploredHiddenChildren && (isHovered || isSelected) ? (
@@ -335,9 +339,8 @@ export default function LineageEntityNode({
335339
{' '}
336340
|{' '}
337341
</tspan>
338-
<tspan dx=".25em" dy="-2px">
339-
{capitalizeFirstLetterOnly(node.data.subtype) ||
340-
(node.data.type && entityRegistry.getEntityName(node.data.type))}
342+
<tspan dx=".25em" dy="-2px" data-testid={entityName}>
343+
{entityName}
341344
</tspan>
342345
</UnselectableText>
343346
{expandTitles ? (

smoke-test/tests/cypress/cypress/e2e/siblings/siblings.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ describe('siblings', () => {
113113
cy.clickOptionWithTestId('compress-lineage-toggle');
114114

115115
// check the subtypes
116-
cy.get('text:contains(View)').should('have.length', 2);
117-
cy.get('text:contains(Table)').should('have.length', 0);
118-
cy.get('text:contains(Seed)').should('have.length', 1);
116+
cy.get('[data-testid="Seed"]').should('have.length', 1);
117+
// center counts twice since we secretely render two center nodes, plus the downstream bigquery
118+
cy.get('[data-testid="View"]').should('have.length', 3);
119+
cy.get('[data-testid="Table"]').should('have.length', 0);
120+
119121

120122
// check the names
121123
cy.get('text:contains(raw_orders)').should('have.length', 1);

0 commit comments

Comments
 (0)