From 4a3a9dea1ae7193ca1f07c28d73123b624a44674 Mon Sep 17 00:00:00 2001 From: Arpit Dalal Date: Tue, 8 Oct 2024 15:17:18 -0400 Subject: [PATCH] test: fix twitter/x test --- index.js | 10 +++++----- tests/twitter.test.js | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 9fee2e5..254cef2 100644 --- a/index.js +++ b/index.js @@ -66,7 +66,7 @@ const URLS = { }, github: "https://github.com/arpitdalal/", linkedin: "https://linkedin.com/in/arpitdalal/", - twitter: "https://twitter.com/arpitdalal_dev/", + x: "https://x.com/arpitdalal_dev/", youtube: "https://youtube.com/@arpitdalal_dev/", mail: "mailto:arpitdalalm@gmail.com", xman: "https://xman.arpitdalal.dev/", @@ -93,8 +93,8 @@ function githubHandler(req, res, pathToRemove) { function linkedinHandler(res) { res.redirect(URLS.linkedin); } -function twitterHandler(res) { - res.redirect(URLS.twitter); +function xHandler(res) { + res.redirect(URLS.x); } function youtubeHandler(res) { res.redirect(URLS.youtube); @@ -129,10 +129,10 @@ app.get("/linkedin/:path(*)?", (_, res) => { }); app.get("/x/:path(*)?", (_, res) => { - twitterHandler(res); + xHandler(res); }); app.get("/twitter/:path(*)?", (_, res) => { - twitterHandler(res); + xHandler(res); }); app.get("/yt/:path(*)?", (_, res) => { diff --git a/tests/twitter.test.js b/tests/twitter.test.js index ab0b29a..ff66e17 100644 --- a/tests/twitter.test.js +++ b/tests/twitter.test.js @@ -1,22 +1,22 @@ import { test, expect } from "@playwright/test"; -test('"/twitter" redirects to "twitter.com/arpitdalal_dev" without utm params', async ({ +test('"/twitter" redirects to "x.com/arpitdalal_dev" without utm params', async ({ page, }) => { await page.goto("/twitter"); // have to check if the url contains twitter and my username because // twitter redirects to the login page if the user is not logged in - expect(page.url()).toContain("twitter"); + expect(page.url()).toContain("x"); expect(page.url()).toContain("arpitdalal_dev"); }); -test('"/x" redirects to "twitter.com/arpitdalal_dev" without utm params', async ({ +test('"/x" redirects to "x.com/arpitdalal_dev" without utm params', async ({ page, }) => { await page.goto("/x"); // have to check if the url contains twitter and my username because // twitter redirects to the login page if the user is not logged in - expect(page.url()).toContain("twitter"); + expect(page.url()).toContain("x"); expect(page.url()).toContain("arpitdalal_dev"); });