fix(test): increase siblings.js test stability (#8542)

This commit is contained in:
david-leifker 2023-08-01 19:59:30 -05:00 committed by GitHub
parent e380f7d317
commit 4f9fc671dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -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) ? (
@ -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 ? (

View File

@ -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);