fix(client): change twitter to X and update twitter URL's (#64046)

This commit is contained in:
Tom
2025-12-08 04:49:23 -06:00
committed by GitHub
parent a09b4301de
commit 6a54b7c43f
11 changed files with 18 additions and 22 deletions
+1 -1
View File
@@ -307,7 +307,7 @@ const publicUserData = {
portfolio: testUserData.portfolio,
profileUI: testUserData.profileUI,
savedChallenges: testUserData.savedChallenges,
twitter: 'https://twitter.com/foobar',
twitter: 'https://x.com/foobar',
bluesky: 'https://bsky.app/profile/foobar',
sendQuincyEmail: testUserData.sendQuincyEmail,
username: testUserData.username,
+1 -1
View File
@@ -218,7 +218,7 @@ const publicUserData = {
points: 2,
portfolio: testUserData.portfolio,
profileUI: testUserData.profileUI,
twitter: 'https://twitter.com/foobar',
twitter: 'https://x.com/foobar',
bluesky: 'https://bsky.app/profile/foobar',
username: testUserData.username,
usernameDisplay: testUserData.usernameDisplay,
+3 -5
View File
@@ -12,14 +12,12 @@ import {
describe('normalize', () => {
describe('normalizeTwitter', () => {
test('returns the input if it is a url', () => {
const url = 'https://twitter.com/a_generic_user';
const url = 'https://x.com/a_generic_user';
expect(normalizeTwitter(url)).toEqual(url);
});
test('adds the handle to twitter.com if it is not a url', () => {
test('adds the handle to x.com if it is not a url', () => {
const handle = '@a_generic_user';
expect(normalizeTwitter(handle)).toEqual(
'https://twitter.com/a_generic_user'
);
expect(normalizeTwitter(handle)).toEqual('https://x.com/a_generic_user');
});
test('returns undefined if that is the input', () => {
expect(normalizeTwitter('')).toBeUndefined();
+1 -1
View File
@@ -35,7 +35,7 @@ export const normalizeTwitter = (
try {
new URL(handleOrUrl);
} catch {
url = `https://twitter.com/${handleOrUrl.replace(/^@/, '')}`;
url = `https://x.com/${handleOrUrl.replace(/^@/, '')}`;
}
return url ?? handleOrUrl;
};