Skip to content

Commit

Permalink
fix(test): increase siblings.js test stability (#8542)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored Aug 2, 2023
1 parent e380f7d commit 4f9fc67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 6 additions & 3 deletions datahub-web-react/src/app/lineage/LineageEntityNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ export default function LineageEntityNode({
areColumnsCollapsed,
);

const entityName =
capitalizeFirstLetterOnly(node.data.subtype) ||
(node.data.type && entityRegistry.getEntityName(node.data.type));

return (
<PointerGroup data-testid={`node-${node.data.urn}-${direction}`} top={node.x} left={node.y}>
{unexploredHiddenChildren && (isHovered || isSelected) ? (
Expand Down Expand Up @@ -335,9 +339,8 @@ export default function LineageEntityNode({
{' '}
|{' '}
</tspan>
<tspan dx=".25em" dy="-2px">
{capitalizeFirstLetterOnly(node.data.subtype) ||
(node.data.type && entityRegistry.getEntityName(node.data.type))}
<tspan dx=".25em" dy="-2px" data-testid={entityName}>
{entityName}
</tspan>
</UnselectableText>
{expandTitles ? (
Expand Down
8 changes: 5 additions & 3 deletions smoke-test/tests/cypress/cypress/e2e/siblings/siblings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4f9fc67

Please sign in to comment.