fix: refactor OG link builder (#17897)

* fix: manually encode special characters

* fix test

* fix

* fix
This commit is contained in:
Benny Joo authored and GitHub committed 2024-12-02 19:01:09 +00:00
1 parent 262738f288
commit d057d7d37f
5 files changed
+35 -35

No files matched your search

@@ -64,9 +64,10 @@ test.describe("User Avatar", async () => {
);
// verify objectKey is passed to the OG image
// yes, OG image URI encodes at multiple places.. don't want to mess with that.
const searchParam = `meetingImage=${encodeURIComponent(`${CAL_URL}/api/avatar/${objectKey}.png`)}`;
await expect(page.locator('meta[property="og:image"]')).toHaveAttribute(
"content",
new RegExp(`meetingImage=${encodeURIComponent(`${CAL_URL}/api/avatar/${objectKey}.png`)}`)
new RegExp(encodeURIComponent(searchParam))
);
});
});