Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Check that embed earnings have no partner link title

Rafi7e8a9b6bf8f3
diff --git a/apps/web/tests/embed-tokens/referrals.test.ts b/apps/web/tests/embed-tokens/referrals.test.ts
index fa6cf8aee0..336d0ecc2f 100644
--- a/apps/web/tests/embed-tokens/referrals.test.ts
+++ b/apps/web/tests/embed-tokens/referrals.test.ts
@@ -80,6 +80,29 @@ describe.sequential("POST /api/tokens/embed/referrals", async () => {
expect(data).toStrictEqual(expectedTokenResponse);
});
+ test("embed earnings do not include the partner link title", async () => {
+ const { data: token } = await http.post<{ publicToken: string }>({
+ path: "/tokens/embed/referrals",
+ body: {
+ partnerId: E2E_PARTNER.id,
+ },
+ });
+
+ const { data, status } = await http.get<
+ { link?: Record<string, unknown> | null }[]
+ >({
+ path: "/embed/referrals/earnings",
+ headers: {
+ Authorization: `Bearer ${token.publicToken}`,
+ },
+ });
+
+ expect(status).toEqual(200);
+ expect(
+ data.every(({ link }) => !link || !("partnerLinkTitle" in link)),
+ ).toBe(true);
+ });
+
test("fails with no partnerId, tenantId, or partner", async () => {
const { data, status } = await http.post({
path: "/tokens/embed/referrals",