fix: double icon on user event type (#15239)

* fix: double icon

* test: add test for user event type
This commit is contained in:
Udit Takkar
2024-05-29 13:23:58 +00:00
committed by GitHub
parent 4cdcc85620
commit d19034c2d5
3 changed files with 14 additions and 2 deletions
+7
View File
@@ -47,6 +47,13 @@ test("check SSR and OG - User Event Type", async ({ page, users }) => {
const canonicalLink = document.querySelector('link[rel="canonical"]')?.getAttribute("href");
expect(titleText).toContain(name);
expect(ogUrl).toEqual(`${WEBAPP_URL}/${user.username}/30-min`);
const avatarLocators = await page.locator('[data-testid="avatar-href"]').all();
expect(avatarLocators.length).toBe(1);
for (const avatarLocator of avatarLocators) {
expect(await avatarLocator.getAttribute("href")).toEqual(`${WEBAPP_URL}/${user.username}?redirect=false`);
}
expect(canonicalLink).toEqual(`${WEBAPP_URL}/${user.username}/30-min`);
// Verify that there is correct URL that would generate the awesome OG image
expect(ogImage).toContain(
@@ -32,7 +32,7 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe
(profile.name !== users[0].name && schedulingType === SchedulingType.COLLECTIVE);
const orgOrTeamAvatarItem =
isDynamic || (!profile.image && !entity.logoUrl)
isDynamic || (!profile.image && !entity.logoUrl) || !entity.teamSlug
? []
: [
{
@@ -47,6 +47,7 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe
title: entity.name ?? profile.name ?? "",
},
];
return (
<>
<AvatarGroup
+5 -1
View File
@@ -66,7 +66,11 @@ export function Avatar(props: AvatarProps) {
);
if (href) {
avatar = <Link href={href}>{avatar}</Link>;
avatar = (
<Link data-testid="avatar-href" href={href}>
{avatar}
</Link>
);
}
return title ? (