Skip to content

Commit

Permalink
fix broken cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Collins authored and Chris Collins committed Sep 9, 2022
1 parent cdd8f37 commit 47e9e76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions datahub-web-react/src/app/shared/tags/TagTermGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,10 @@ export default function TagTermGroup({
);
if (maxShow && renderedTags > maxShow) return null;

const displayName = entityRegistry.getDisplayName(EntityType.Tag, tag.tag);
return (
<HoverEntityTooltip entity={tag?.tag}>
<TagLink key={tag?.tag?.urn}>
<TagLink key={tag?.tag?.urn} data-testid={`tag-${displayName}`}>
<StyledTag
style={{ cursor: 'pointer' }}
onClick={() => showTagProfileDrawer(tag?.tag?.urn)}
Expand All @@ -258,7 +259,7 @@ export default function TagTermGroup({
closable={false}
>
<Highlight matchStyle={highlightMatchStyle} search={highlightText}>
{entityRegistry.getDisplayName(EntityType.Tag, tag.tag)}
{displayName}
</Highlight>
</StyledTag>
</TagLink>
Expand All @@ -269,9 +270,11 @@ export default function TagTermGroup({
{editableTags?.tags?.map((tag) => {
renderedTags += 1;
if (maxShow && renderedTags > maxShow) return null;

const displayName = entityRegistry.getDisplayName(EntityType.Tag, tag.tag);
return (
<HoverEntityTooltip entity={tag?.tag}>
<TagLink>
<TagLink data-testid={`tag-${displayName}`}>
<StyledTag
style={{ cursor: 'pointer' }}
onClick={() => showTagProfileDrawer(tag?.tag?.urn)}
Expand All @@ -284,7 +287,7 @@ export default function TagTermGroup({
}}
>
<Highlight matchStyle={highlightMatchStyle} search={highlightText}>
{tag?.tag?.name}
{displayName}
</Highlight>
</StyledTag>
</TagLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe("mutations", () => {
before(() => {
// warm up elastic by issuing a `*` search
cy.login();
cy.visit("http://localhost:9002/search?query=%2A");
cy.visit("http://localhost:3000/search?query=%2A");
cy.wait(5000);
});

Expand Down Expand Up @@ -50,7 +50,7 @@ describe("mutations", () => {
// verify dataset shows up in search now
cy.contains("of 1 result").click({ force: true });
cy.contains("cypress_logging_events").click({ force: true });
cy.contains("CypressTestAddTag").within(() =>
cy.get('[data-testid="tag-CypressTestAddTag"]').within(() =>
cy.get("span[aria-label=close]").click()
);
cy.contains("Yes").click();
Expand Down Expand Up @@ -138,7 +138,7 @@ describe("mutations", () => {
// verify dataset shows up in search now
cy.contains("of 1 result").click();
cy.contains("cypress_logging_events").click();
cy.contains("CypressTestAddTag2").within(() =>
cy.get('[data-testid="tag-CypressTestAddTag2"]').within(() =>
cy
.get("span[aria-label=close]")
.trigger("mouseover", { force: true })
Expand Down

0 comments on commit 47e9e76

Please # to comment.