Barazo AppView backend barazo.forum

chore(tests): use gender-neutral example names (#112)

* chore(tests): use gender-neutral example names

Replace gendered placeholder names (Alice, Bob) with gender-neutral
alternatives (Jay, Alex) across all test fixtures, mock data, and
scripts. Aligns with project language standards.

* fix(tests): remove real surname from mock display names

Replace "Jay Graber" with just "Jay" to avoid using a real person's
full name in test fixtures.

authored by

Guido X Jansen and committed by
GitHub
92763077 5459ed0a

+137 -137
+2 -2
scripts/test-oauth.sh
··· 14 14 # chmod +x scripts/test-oauth.sh 15 15 # ./scripts/test-oauth.sh [handle] 16 16 # 17 - # handle: Your Bluesky handle (e.g. alice.bsky.social). If omitted, 17 + # handle: Your Bluesky handle (e.g. jay.bsky.team). If omitted, 18 18 # the script will prompt for it. 19 19 # --------------------------------------------------------------------------- 20 20 set -euo pipefail ··· 189 189 190 190 HANDLE="${1:-}" 191 191 if [ -z "$HANDLE" ]; then 192 - echo -en "\n ${BOLD}Enter your Bluesky handle${RESET} (e.g. alice.bsky.social): " 192 + echo -en "\n ${BOLD}Enter your Bluesky handle${RESET} (e.g. jay.bsky.team): " 193 193 read -r HANDLE 194 194 fi 195 195
+1 -1
src/routes/profiles.ts
··· 510 510 let pdsTrustFactor = 0.3 // Default for unknown PDS 511 511 try { 512 512 const handleParts = user.handle.split('.') 513 - // Extract host: "alice.bsky.social" -> "bsky.social", "alice.example.com" -> "example.com" 513 + // Extract host: "jay.bsky.team" -> "bsky.team", "user.example.com" -> "example.com" 514 514 const pdsHost = handleParts.length > 1 ? handleParts.slice(1).join('.') : user.handle 515 515 516 516 const pdsRows = await db
+1 -1
tests/unit/auth/middleware.test.ts
··· 57 57 const VALID_SESSION: Session = { 58 58 sid: 's'.repeat(64), 59 59 did: 'did:plc:abc123', 60 - handle: 'alice.bsky.social', 60 + handle: 'jay.bsky.team', 61 61 accessTokenHash: 'h'.repeat(64), 62 62 accessTokenExpiresAt: Date.now() + 900_000, 63 63 createdAt: Date.now() - 60_000,
+1 -1
tests/unit/auth/session.test.ts
··· 70 70 } 71 71 72 72 const testDid = 'did:plc:test-user-123' 73 - const testHandle = 'alice.bsky.social' 73 + const testHandle = 'jay.bsky.team' 74 74 75 75 /** 76 76 * Build a mock persisted session (as stored in Valkey).
+1 -1
tests/unit/lib/did-document-verifier.test.ts
··· 49 49 function activeDidDoc() { 50 50 return { 51 51 id: TEST_DID, 52 - alsoKnownAs: ['at://alice.bsky.social'], 52 + alsoKnownAs: ['at://jay.bsky.team'], 53 53 verificationMethods: { atproto: 'did:key:z123' }, 54 54 rotationKeys: ['did:key:z456'], 55 55 services: {
+1 -1
tests/unit/lib/handle-resolver.test.ts
··· 33 33 // --------------------------------------------------------------------------- 34 34 35 35 const TEST_DID = 'did:plc:test123456789' 36 - const TEST_HANDLE = 'alice.bsky.social' 36 + const TEST_HANDLE = 'jay.bsky.team' 37 37 38 38 // --------------------------------------------------------------------------- 39 39 // Test suite
+38 -38
tests/unit/lib/resolve-authors.test.ts
··· 17 17 } 18 18 19 19 describe('resolveAuthors', () => { 20 - const didAlice = 'did:plc:alice111' 21 - const didBob = 'did:plc:bob222' 20 + const didJay = 'did:plc:jay111' 21 + const didAlex = 'did:plc:alex222' 22 22 const communityDid = 'did:plc:community123' 23 23 24 24 it('returns empty map for empty DID list', async () => { ··· 32 32 const db = createMockDb( 33 33 [ 34 34 { 35 - did: didAlice, 36 - handle: 'alice.bsky.social', 37 - displayName: 'Alice', 38 - avatarUrl: 'https://cdn.example.com/alice.jpg', 35 + did: didJay, 36 + handle: 'jay.bsky.team', 37 + displayName: 'Jay', 38 + avatarUrl: 'https://cdn.example.com/jay.jpg', 39 39 bannerUrl: null, 40 40 bio: null, 41 41 }, 42 42 { 43 - did: didBob, 44 - handle: 'bob.bsky.social', 43 + did: didAlex, 44 + handle: 'alex.bsky.team', 45 45 displayName: null, 46 46 avatarUrl: null, 47 47 bannerUrl: null, ··· 51 51 [] 52 52 ) 53 53 54 - const result = await resolveAuthors([didAlice, didBob], null, db as never) 54 + const result = await resolveAuthors([didJay, didAlex], null, db as never) 55 55 56 56 expect(result.size).toBe(2) 57 - expect(result.get(didAlice)).toEqual({ 58 - did: didAlice, 59 - handle: 'alice.bsky.social', 60 - displayName: 'Alice', 61 - avatarUrl: 'https://cdn.example.com/alice.jpg', 57 + expect(result.get(didJay)).toEqual({ 58 + did: didJay, 59 + handle: 'jay.bsky.team', 60 + displayName: 'Jay', 61 + avatarUrl: 'https://cdn.example.com/jay.jpg', 62 62 }) 63 - expect(result.get(didBob)).toEqual({ 64 - did: didBob, 65 - handle: 'bob.bsky.social', 63 + expect(result.get(didAlex)).toEqual({ 64 + did: didAlex, 65 + handle: 'alex.bsky.team', 66 66 displayName: null, 67 67 avatarUrl: null, 68 68 }) ··· 72 72 const db = createMockDb( 73 73 [ 74 74 { 75 - did: didAlice, 76 - handle: 'alice.bsky.social', 77 - displayName: 'Alice', 78 - avatarUrl: 'https://cdn.example.com/alice.jpg', 75 + did: didJay, 76 + handle: 'jay.bsky.team', 77 + displayName: 'Jay', 78 + avatarUrl: 'https://cdn.example.com/jay.jpg', 79 79 bannerUrl: null, 80 80 bio: null, 81 81 }, 82 82 ], 83 83 [ 84 84 { 85 - did: didAlice, 85 + did: didJay, 86 86 communityDid, 87 - displayName: 'Alice in Community', 88 - avatarUrl: 'https://cdn.example.com/alice-community.jpg', 87 + displayName: 'Jay in Community', 88 + avatarUrl: 'https://cdn.example.com/jay-community.jpg', 89 89 bannerUrl: null, 90 90 bio: null, 91 91 }, 92 92 ] 93 93 ) 94 94 95 - const result = await resolveAuthors([didAlice], communityDid, db as never) 95 + const result = await resolveAuthors([didJay], communityDid, db as never) 96 96 97 - expect(result.get(didAlice)).toEqual({ 98 - did: didAlice, 99 - handle: 'alice.bsky.social', 100 - displayName: 'Alice in Community', 101 - avatarUrl: 'https://cdn.example.com/alice-community.jpg', 97 + expect(result.get(didJay)).toEqual({ 98 + did: didJay, 99 + handle: 'jay.bsky.team', 100 + displayName: 'Jay in Community', 101 + avatarUrl: 'https://cdn.example.com/jay-community.jpg', 102 102 }) 103 103 }) 104 104 ··· 106 106 const db = createMockDb( 107 107 [ 108 108 { 109 - did: didAlice, 110 - handle: 'alice.bsky.social', 111 - displayName: 'Alice', 109 + did: didJay, 110 + handle: 'jay.bsky.team', 111 + displayName: 'Jay', 112 112 avatarUrl: null, 113 113 bannerUrl: null, 114 114 bio: null, ··· 117 117 [] 118 118 ) 119 119 120 - const result = await resolveAuthors([didAlice, didAlice, didAlice], null, db as never) 120 + const result = await resolveAuthors([didJay, didJay, didJay], null, db as never) 121 121 122 122 expect(result.size).toBe(1) 123 123 }) ··· 125 125 it('returns fallback for DIDs not found in users table', async () => { 126 126 const db = createMockDb([], []) 127 127 128 - const result = await resolveAuthors([didAlice], null, db as never) 128 + const result = await resolveAuthors([didJay], null, db as never) 129 129 130 - expect(result.get(didAlice)).toEqual({ 131 - did: didAlice, 132 - handle: didAlice, 130 + expect(result.get(didJay)).toEqual({ 131 + did: didJay, 132 + handle: didJay, 133 133 displayName: null, 134 134 avatarUrl: null, 135 135 })
+10 -10
tests/unit/lib/resolve-profile.test.ts
··· 11 11 12 12 const baseSource: SourceProfile = { 13 13 did: 'did:plc:abc123', 14 - handle: 'alice.bsky.social', 15 - displayName: 'Alice', 14 + handle: 'jay.bsky.team', 15 + displayName: 'Jay', 16 16 avatarUrl: 'https://cdn.example.com/avatar.jpg', 17 17 bannerUrl: 'https://cdn.example.com/banner.jpg', 18 18 bio: 'Hello from the AT Protocol', ··· 24 24 25 25 expect(result).toEqual({ 26 26 did: 'did:plc:abc123', 27 - handle: 'alice.bsky.social', 28 - displayName: 'Alice', 27 + handle: 'jay.bsky.team', 28 + displayName: 'Jay', 29 29 avatarUrl: 'https://cdn.example.com/avatar.jpg', 30 30 bannerUrl: 'https://cdn.example.com/banner.jpg', 31 31 bio: 'Hello from the AT Protocol', ··· 34 34 35 35 it('uses all override values when every field is set', () => { 36 36 const override: CommunityOverride = { 37 - displayName: 'Alice in Wonderland', 37 + displayName: 'Jay in Wonderland', 38 38 avatarUrl: 'https://cdn.example.com/community-avatar.jpg', 39 39 bannerUrl: 'https://cdn.example.com/community-banner.jpg', 40 40 bio: 'Community-specific bio', ··· 44 44 45 45 expect(result).toEqual({ 46 46 did: 'did:plc:abc123', 47 - handle: 'alice.bsky.social', 48 - displayName: 'Alice in Wonderland', 47 + handle: 'jay.bsky.team', 48 + displayName: 'Jay in Wonderland', 49 49 avatarUrl: 'https://cdn.example.com/community-avatar.jpg', 50 50 bannerUrl: 'https://cdn.example.com/community-banner.jpg', 51 51 bio: 'Community-specific bio', ··· 54 54 55 55 it('falls back to source for null override fields', () => { 56 56 const override: CommunityOverride = { 57 - displayName: 'Community Alice', 57 + displayName: 'Jay in the Community', 58 58 avatarUrl: null, 59 59 bannerUrl: null, 60 60 bio: 'Override bio only', ··· 64 64 65 65 expect(result).toEqual({ 66 66 did: 'did:plc:abc123', 67 - handle: 'alice.bsky.social', 68 - displayName: 'Community Alice', 67 + handle: 'jay.bsky.team', 68 + displayName: 'Jay in the Community', 69 69 avatarUrl: 'https://cdn.example.com/avatar.jpg', 70 70 bannerUrl: 'https://cdn.example.com/banner.jpg', 71 71 bio: 'Override bio only',
+1 -1
tests/unit/routes/admin-settings.test.ts
··· 26 26 // --------------------------------------------------------------------------- 27 27 28 28 const TEST_DID = 'did:plc:testuser123' 29 - const TEST_HANDLE = 'alice.bsky.social' 29 + const TEST_HANDLE = 'jay.bsky.team' 30 30 const TEST_SID = 'a'.repeat(64) 31 31 const ADMIN_DID = 'did:plc:admin999' 32 32 const TEST_NOW = '2026-02-13T12:00:00.000Z'
+1 -1
tests/unit/routes/admin-sybil.test.ts
··· 25 25 // --------------------------------------------------------------------------- 26 26 27 27 const TEST_DID = 'did:plc:testuser123' 28 - const TEST_HANDLE = 'alice.bsky.social' 28 + const TEST_HANDLE = 'jay.bsky.team' 29 29 const TEST_SID = 'a'.repeat(64) 30 30 const ADMIN_DID = 'did:plc:admin999' 31 31 const TEST_NOW = '2026-02-13T12:00:00.000Z'
+13 -13
tests/unit/routes/auth.test.ts
··· 98 98 // --------------------------------------------------------------------------- 99 99 100 100 const TEST_DID = 'did:plc:test123456789' 101 - const TEST_HANDLE = 'alice.bsky.social' 101 + const TEST_HANDLE = 'jay.bsky.team' 102 102 const TEST_SID = 'a'.repeat(64) 103 103 const TEST_ACCESS_TOKEN = 'b'.repeat(64) 104 104 const TEST_ACCESS_TOKEN_HASH = 'c'.repeat(64) ··· 182 182 183 183 const response = await app.inject({ 184 184 method: 'GET', 185 - url: '/api/auth/login?handle=alice.bsky.social', 185 + url: '/api/auth/login?handle=jay.bsky.team', 186 186 }) 187 187 188 188 expect(response.statusCode).toBe(200) 189 189 const body = response.json<{ url: string }>() 190 190 expect(body.url).toBe(redirectUrl.toString()) 191 - expect(authorizeFn).toHaveBeenCalledWith('alice.bsky.social', { scope: BARAZO_BASE_SCOPES }) 191 + expect(authorizeFn).toHaveBeenCalledWith('jay.bsky.team', { scope: BARAZO_BASE_SCOPES }) 192 192 }) 193 193 194 194 it('returns 400 for missing handle', async () => { ··· 229 229 230 230 const response = await app.inject({ 231 231 method: 'GET', 232 - url: '/api/auth/login?handle=alice.bsky.social', 232 + url: '/api/auth/login?handle=jay.bsky.team', 233 233 }) 234 234 235 235 expect(response.statusCode).toBe(502) ··· 391 391 refreshSessionFn.mockResolvedValueOnce(mockSession) 392 392 // First select: users table → profile data 393 393 dbWhereFn.mockResolvedValueOnce([ 394 - { displayName: 'Alice Wonderland', avatarUrl: 'https://cdn.bsky.app/avatar.jpg' }, 394 + { displayName: 'Jay', avatarUrl: 'https://cdn.bsky.app/avatar.jpg' }, 395 395 ]) 396 396 // Second select: userPreferences table 397 397 dbWhereFn.mockResolvedValueOnce([]) ··· 404 404 405 405 expect(response.statusCode).toBe(200) 406 406 const body = response.json<{ displayName: string | null; avatarUrl: string | null }>() 407 - expect(body.displayName).toBe('Alice Wonderland') 407 + expect(body.displayName).toBe('Jay') 408 408 expect(body.avatarUrl).toBe('https://cdn.bsky.app/avatar.jpg') 409 409 }) 410 410 ··· 524 524 validateAccessTokenFn.mockResolvedValueOnce(mockSession) 525 525 // First select: users table → profile data 526 526 dbWhereFn.mockResolvedValueOnce([ 527 - { displayName: 'Alice Wonderland', avatarUrl: 'https://cdn.bsky.app/avatar.jpg' }, 527 + { displayName: 'Jay', avatarUrl: 'https://cdn.bsky.app/avatar.jpg' }, 528 528 ]) 529 529 // Second select: userPreferences table 530 530 dbWhereFn.mockResolvedValueOnce([]) ··· 537 537 538 538 expect(response.statusCode).toBe(200) 539 539 const body = response.json<{ displayName: string | null; avatarUrl: string | null }>() 540 - expect(body.displayName).toBe('Alice Wonderland') 540 + expect(body.displayName).toBe('Jay') 541 541 expect(body.avatarUrl).toBe('https://cdn.bsky.app/avatar.jpg') 542 542 }) 543 543 ··· 653 653 654 654 const response = await app.inject({ 655 655 method: 'GET', 656 - url: '/api/auth/login?handle=alice.bsky.social', 656 + url: '/api/auth/login?handle=jay.bsky.team', 657 657 }) 658 658 659 659 expect(response.statusCode).toBe(200) ··· 661 661 expect(body.url).toBe(fallbackUrl.toString()) 662 662 663 663 // First call with granular scopes 664 - expect(authorizeFn).toHaveBeenNthCalledWith(1, 'alice.bsky.social', { 664 + expect(authorizeFn).toHaveBeenNthCalledWith(1, 'jay.bsky.team', { 665 665 scope: BARAZO_BASE_SCOPES, 666 666 }) 667 667 // Second call with fallback 668 - expect(authorizeFn).toHaveBeenNthCalledWith(2, 'alice.bsky.social', { scope: FALLBACK_SCOPE }) 668 + expect(authorizeFn).toHaveBeenNthCalledWith(2, 'jay.bsky.team', { scope: FALLBACK_SCOPE }) 669 669 }) 670 670 671 671 it('requests cross-post scopes when crosspost=true', async () => { ··· 674 674 675 675 const response = await app.inject({ 676 676 method: 'GET', 677 - url: '/api/auth/login?handle=alice.bsky.social&crosspost=true', 677 + url: '/api/auth/login?handle=jay.bsky.team&crosspost=true', 678 678 }) 679 679 680 680 expect(response.statusCode).toBe(200) 681 - expect(authorizeFn).toHaveBeenCalledWith('alice.bsky.social', { 681 + expect(authorizeFn).toHaveBeenCalledWith('jay.bsky.team', { 682 682 scope: BARAZO_CROSSPOST_SCOPES, 683 683 }) 684 684 })
+1 -1
tests/unit/routes/block-mute.test.ts
··· 26 26 // --------------------------------------------------------------------------- 27 27 28 28 const TEST_DID = 'did:plc:testuser123' 29 - const TEST_HANDLE = 'alice.bsky.social' 29 + const TEST_HANDLE = 'jay.bsky.team' 30 30 const TEST_SID = 'a'.repeat(64) 31 31 const TARGET_DID = 'did:plc:targetuser456' 32 32 const INVALID_DID = 'not-a-did'
+1 -1
tests/unit/routes/categories.test.ts
··· 26 26 // --------------------------------------------------------------------------- 27 27 28 28 const TEST_DID = 'did:plc:testuser123' 29 - const TEST_HANDLE = 'alice.bsky.social' 29 + const TEST_HANDLE = 'jay.bsky.team' 30 30 const TEST_SID = 'a'.repeat(64) 31 31 const ADMIN_DID = 'did:plc:admin999' 32 32 const TEST_NOW = '2026-02-13T12:00:00.000Z'
+8 -8
tests/unit/routes/community-profiles.test.ts
··· 26 26 // --------------------------------------------------------------------------- 27 27 28 28 const TEST_DID = 'did:plc:testuser123' 29 - const TEST_HANDLE = 'alice.bsky.social' 29 + const TEST_HANDLE = 'jay.bsky.team' 30 30 const TEST_SID = 'a'.repeat(64) 31 31 const COMMUNITY_DID = 'did:plc:community456' 32 32 const TEST_NOW = '2026-02-14T12:00:00.000Z' ··· 52 52 return { 53 53 did: TEST_DID, 54 54 handle: TEST_HANDLE, 55 - displayName: 'Alice', 55 + displayName: 'Jay', 56 56 avatarUrl: 'https://example.com/avatar.jpg', 57 57 bannerUrl: 'https://example.com/banner.jpg', 58 58 bio: 'Global bio', ··· 71 71 return { 72 72 did: TEST_DID, 73 73 communityDid: COMMUNITY_DID, 74 - displayName: 'Community Alice', 74 + displayName: 'Jay in the Community', 75 75 avatarUrl: null, 76 76 bannerUrl: null, 77 77 bio: 'Community-specific bio', ··· 201 201 }>() 202 202 expect(body.did).toBe(TEST_DID) 203 203 expect(body.handle).toBe(TEST_HANDLE) 204 - expect(body.displayName).toBe('Alice') 204 + expect(body.displayName).toBe('Jay') 205 205 expect(body.avatarUrl).toBe('https://example.com/avatar.jpg') 206 206 expect(body.bannerUrl).toBe('https://example.com/banner.jpg') 207 207 expect(body.bio).toBe('Global bio') 208 208 expect(body.communityDid).toBe(COMMUNITY_DID) 209 209 expect(body.hasOverride).toBe(false) 210 - expect(body.source.displayName).toBe('Alice') 210 + expect(body.source.displayName).toBe('Jay') 211 211 expect(body.source.avatarUrl).toBe('https://example.com/avatar.jpg') 212 212 }) 213 213 ··· 241 241 } 242 242 }>() 243 243 // Override fields take precedence 244 - expect(body.displayName).toBe('Community Alice') 244 + expect(body.displayName).toBe('Jay in the Community') 245 245 expect(body.bio).toBe('Community-specific bio') 246 246 // Null override fields fall back to source 247 247 expect(body.avatarUrl).toBe('https://example.com/avatar.jpg') 248 248 expect(body.bannerUrl).toBe('https://example.com/banner.jpg') 249 249 expect(body.hasOverride).toBe(true) 250 250 // Source always shows original values 251 - expect(body.source.displayName).toBe('Alice') 251 + expect(body.source.displayName).toBe('Jay') 252 252 expect(body.source.bio).toBe('Global bio') 253 253 }) 254 254 ··· 304 304 url: `/api/communities/${COMMUNITY_DID}/profile`, 305 305 headers: { authorization: 'Bearer test-token' }, 306 306 payload: { 307 - displayName: 'Community Alice', 307 + displayName: 'Jay in the Community', 308 308 bio: 'Community-specific bio', 309 309 }, 310 310 })
+1 -1
tests/unit/routes/maturity-filtering.test.ts
··· 39 39 // --------------------------------------------------------------------------- 40 40 41 41 const TEST_DID = 'did:plc:testuser123' 42 - const TEST_HANDLE = 'alice.bsky.social' 42 + const TEST_HANDLE = 'jay.bsky.team' 43 43 const TEST_SID = 'a'.repeat(64) 44 44 const TEST_NOW = '2026-02-13T12:00:00.000Z' 45 45
+1 -1
tests/unit/routes/moderation-appeals.test.ts
··· 37 37 // --------------------------------------------------------------------------- 38 38 39 39 const TEST_DID = 'did:plc:testuser123' 40 - const TEST_HANDLE = 'alice.bsky.social' 40 + const TEST_HANDLE = 'jay.bsky.team' 41 41 const TEST_SID = 'a'.repeat(64) 42 42 const ADMIN_DID = 'did:plc:admin999' 43 43 const OTHER_DID = 'did:plc:otheruser456'
+3 -3
tests/unit/routes/moderation.test.ts
··· 37 37 // --------------------------------------------------------------------------- 38 38 39 39 const TEST_DID = 'did:plc:testuser123' 40 - const TEST_HANDLE = 'alice.bsky.social' 40 + const TEST_HANDLE = 'jay.bsky.team' 41 41 const TEST_SID = 'a'.repeat(64) 42 42 const ADMIN_DID = 'did:plc:admin999' 43 43 const OTHER_DID = 'did:plc:otheruser456' ··· 206 206 function sampleUserRow(overrides?: Record<string, unknown>) { 207 207 return { 208 208 did: OTHER_DID, 209 - handle: 'bob.bsky.social', 210 - displayName: 'Bob', 209 + handle: 'alex.bsky.team', 210 + displayName: 'Alex', 211 211 avatarUrl: null, 212 212 role: 'user', 213 213 isBanned: false,
+1 -1
tests/unit/routes/notifications.test.ts
··· 26 26 // --------------------------------------------------------------------------- 27 27 28 28 const TEST_DID = 'did:plc:testuser123' 29 - const TEST_HANDLE = 'alice.bsky.social' 29 + const TEST_HANDLE = 'jay.bsky.team' 30 30 const TEST_SID = 'a'.repeat(64) 31 31 const ACTOR_DID = 'did:plc:actor456' 32 32 const COMMUNITY_DID = 'did:plc:community123'
+1 -1
tests/unit/routes/onboarding.test.ts
··· 27 27 // --------------------------------------------------------------------------- 28 28 29 29 const TEST_DID = 'did:plc:testuser123' 30 - const TEST_HANDLE = 'alice.bsky.social' 30 + const TEST_HANDLE = 'jay.bsky.team' 31 31 const TEST_SID = 'a'.repeat(64) 32 32 const ADMIN_DID = 'did:plc:admin999' 33 33 const TEST_NOW = '2026-02-15T12:00:00.000Z'
+10 -10
tests/unit/routes/profiles.test.ts
··· 26 26 // --------------------------------------------------------------------------- 27 27 28 28 const TEST_DID = 'did:plc:testuser123' 29 - const TEST_HANDLE = 'alice.bsky.social' 29 + const TEST_HANDLE = 'jay.bsky.team' 30 30 const TEST_SID = 'a'.repeat(64) 31 31 const COMMUNITY_DID = 'did:plc:community123' 32 32 const TEST_NOW = '2026-02-14T12:00:00.000Z' ··· 52 52 return { 53 53 did: TEST_DID, 54 54 handle: TEST_HANDLE, 55 - displayName: 'Alice', 55 + displayName: 'Jay', 56 56 avatarUrl: 'https://example.com/avatar.jpg', 57 57 bannerUrl: 'https://example.com/banner.jpg', 58 - bio: 'Hello, I am Alice', 58 + bio: 'Hello, I am Jay', 59 59 role: 'user', 60 60 isBanned: false, 61 61 reputationScore: 0, ··· 338 338 }>() 339 339 expect(body.did).toBe(TEST_DID) 340 340 expect(body.handle).toBe(TEST_HANDLE) 341 - expect(body.displayName).toBe('Alice') 341 + expect(body.displayName).toBe('Jay') 342 342 expect(body.bannerUrl).toBe('https://example.com/banner.jpg') 343 - expect(body.bio).toBe('Hello, I am Alice') 343 + expect(body.bio).toBe('Hello, I am Jay') 344 344 expect(body.role).toBe('user') 345 345 expect(body.activity.topicCount).toBe(5) 346 346 expect(body.activity.replyCount).toBe(10) ··· 454 454 { 455 455 did: TEST_DID, 456 456 communityDid: COMMUNITY_DID, 457 - displayName: 'Community Alice', 457 + displayName: 'Jay in the Community', 458 458 avatarUrl: null, 459 459 bannerUrl: 'https://example.com/community-banner.jpg', 460 460 bio: null, ··· 477 477 bio: string | null 478 478 }>() 479 479 // Community override takes precedence for displayName and bannerUrl 480 - expect(body.displayName).toBe('Community Alice') 480 + expect(body.displayName).toBe('Jay in the Community') 481 481 expect(body.bannerUrl).toBe('https://example.com/community-banner.jpg') 482 482 // Falls back to source for avatarUrl and bio (override is null) 483 483 expect(body.avatarUrl).toBe('https://example.com/avatar.jpg') 484 - expect(body.bio).toBe('Hello, I am Alice') 484 + expect(body.bio).toBe('Hello, I am Jay') 485 485 }) 486 486 487 487 it('returns source profile when communityDid has no override row', async () => { ··· 520 520 bio: string | null 521 521 }>() 522 522 // Falls back to source values 523 - expect(body.displayName).toBe('Alice') 523 + expect(body.displayName).toBe('Jay') 524 524 expect(body.bannerUrl).toBe('https://example.com/banner.jpg') 525 - expect(body.bio).toBe('Hello, I am Alice') 525 + expect(body.bio).toBe('Hello, I am Jay') 526 526 }) 527 527 528 528 it('returns 404 for unknown handle', async () => {
+1 -1
tests/unit/routes/reactions.test.ts
··· 48 48 // --------------------------------------------------------------------------- 49 49 50 50 const TEST_DID = 'did:plc:testuser123' 51 - const TEST_HANDLE = 'alice.bsky.social' 51 + const TEST_HANDLE = 'jay.bsky.team' 52 52 const TEST_SID = 'a'.repeat(64) 53 53 const OTHER_DID = 'did:plc:otheruser456' 54 54 const COMMUNITY_DID = 'did:plc:community123'
+14 -14
tests/unit/routes/replies.test.ts
··· 85 85 // --------------------------------------------------------------------------- 86 86 87 87 const TEST_DID = 'did:plc:testuser123' 88 - const TEST_HANDLE = 'alice.bsky.social' 88 + const TEST_HANDLE = 'jay.bsky.team' 89 89 const TEST_SID = 'a'.repeat(64) 90 90 91 91 const TEST_TOPIC_URI = `at://${TEST_DID}/forum.barazo.topic.post/abc123` ··· 1007 1007 { 1008 1008 did: TEST_DID, 1009 1009 handle: TEST_HANDLE, 1010 - displayName: 'Alice', 1011 - avatarUrl: 'https://cdn.example.com/alice.jpg', 1010 + displayName: 'Jay', 1011 + avatarUrl: 'https://cdn.example.com/jay.jpg', 1012 1012 bannerUrl: null, 1013 1013 bio: null, 1014 1014 }, 1015 1015 { 1016 1016 did: OTHER_DID, 1017 - handle: 'bob.bsky.social', 1018 - displayName: 'Bob', 1017 + handle: 'alex.bsky.team', 1018 + displayName: 'Alex', 1019 1019 avatarUrl: null, 1020 1020 bannerUrl: null, 1021 1021 bio: null, ··· 1044 1044 expect(body.replies).toHaveLength(2) 1045 1045 1046 1046 // Verify resolved author profile data (not just DID fallback) 1047 - const aliceReply = body.replies.find((r) => r.authorDid === TEST_DID) 1048 - expect(aliceReply?.author).toEqual({ 1047 + const jayReply = body.replies.find((r) => r.authorDid === TEST_DID) 1048 + expect(jayReply?.author).toEqual({ 1049 1049 did: TEST_DID, 1050 1050 handle: TEST_HANDLE, 1051 - displayName: 'Alice', 1052 - avatarUrl: 'https://cdn.example.com/alice.jpg', 1051 + displayName: 'Jay', 1052 + avatarUrl: 'https://cdn.example.com/jay.jpg', 1053 1053 }) 1054 1054 1055 - const bobReply = body.replies.find((r) => r.authorDid === OTHER_DID) 1056 - expect(bobReply?.author).toEqual({ 1055 + const alexReply = body.replies.find((r) => r.authorDid === OTHER_DID) 1056 + expect(alexReply?.author).toEqual({ 1057 1057 did: OTHER_DID, 1058 - handle: 'bob.bsky.social', 1059 - displayName: 'Bob', 1058 + handle: 'alex.bsky.team', 1059 + displayName: 'Alex', 1060 1060 avatarUrl: null, 1061 1061 }) 1062 1062 }) ··· 2044 2044 { 2045 2045 did: TEST_DID, 2046 2046 handle: TEST_HANDLE, 2047 - displayName: 'Alice', 2047 + displayName: 'Jay', 2048 2048 avatarUrl: null, 2049 2049 bannerUrl: null, 2050 2050 bio: null,
+1 -1
tests/unit/routes/setup.test.ts
··· 34 34 // --------------------------------------------------------------------------- 35 35 36 36 const TEST_DID = 'did:plc:test123456789' 37 - const TEST_HANDLE = 'alice.bsky.social' 37 + const TEST_HANDLE = 'jay.bsky.team' 38 38 const TEST_SID = 's'.repeat(64) 39 39 const TEST_ACCESS_TOKEN = 'a'.repeat(64) 40 40
+1 -1
tests/unit/routes/topics-replies-integration.test.ts
··· 79 79 // --------------------------------------------------------------------------- 80 80 81 81 const TEST_DID = 'did:plc:testuser123' 82 - const TEST_HANDLE = 'alice.bsky.social' 82 + const TEST_HANDLE = 'jay.bsky.team' 83 83 const TEST_SID = 'a'.repeat(64) 84 84 85 85 const TEST_TOPIC_URI = `at://${TEST_DID}/forum.barazo.topic.post/topic001`
+6 -6
tests/unit/routes/topics.test.ts
··· 108 108 // --------------------------------------------------------------------------- 109 109 110 110 const TEST_DID = 'did:plc:testuser123' 111 - const TEST_HANDLE = 'alice.bsky.social' 111 + const TEST_HANDLE = 'jay.bsky.team' 112 112 const TEST_SID = 'a'.repeat(64) 113 113 const TEST_URI = `at://${TEST_DID}/forum.barazo.topic.post/abc123` 114 114 const TEST_RKEY = 'abc123' ··· 888 888 { 889 889 did: TEST_DID, 890 890 handle: TEST_HANDLE, 891 - displayName: 'Alice', 892 - avatarUrl: 'https://cdn.example.com/alice.jpg', 891 + displayName: 'Jay', 892 + avatarUrl: 'https://cdn.example.com/jay.jpg', 893 893 bannerUrl: null, 894 894 bio: null, 895 895 }, ··· 906 906 expect(body.topics[0].author).toEqual({ 907 907 did: TEST_DID, 908 908 handle: TEST_HANDLE, 909 - displayName: 'Alice', 910 - avatarUrl: 'https://cdn.example.com/alice.jpg', 909 + displayName: 'Jay', 910 + avatarUrl: 'https://cdn.example.com/jay.jpg', 911 911 }) 912 912 }) 913 913 }) ··· 3360 3360 { 3361 3361 did: TEST_DID, 3362 3362 handle: TEST_HANDLE, 3363 - displayName: 'Alice', 3363 + displayName: 'Jay', 3364 3364 avatarUrl: null, 3365 3365 bannerUrl: null, 3366 3366 bio: null,
+1 -1
tests/unit/routes/uploads.test.ts
··· 45 45 // --------------------------------------------------------------------------- 46 46 47 47 const TEST_DID = 'did:plc:testuser123' 48 - const TEST_HANDLE = 'alice.bsky.social' 48 + const TEST_HANDLE = 'jay.bsky.team' 49 49 const TEST_SID = 'a'.repeat(64) 50 50 const COMMUNITY_DID = 'did:plc:community456' 51 51
+1 -1
tests/unit/routes/votes.test.ts
··· 48 48 // --------------------------------------------------------------------------- 49 49 50 50 const TEST_DID = 'did:plc:testuser123' 51 - const TEST_HANDLE = 'alice.bsky.social' 51 + const TEST_HANDLE = 'jay.bsky.team' 52 52 const TEST_SID = 'a'.repeat(64) 53 53 const OTHER_DID = 'did:plc:otheruser456' 54 54 const COMMUNITY_DID = 'did:plc:community123'
+8 -8
tests/unit/services/notification.test.ts
··· 54 54 55 55 describe('extractMentions', () => { 56 56 it('extracts single AT Protocol handle', () => { 57 - const result = extractMentions('Hello @alice.bsky.social, welcome!') 58 - expect(result).toEqual(['alice.bsky.social']) 57 + const result = extractMentions('Hello @jay.bsky.team, welcome!') 58 + expect(result).toEqual(['jay.bsky.team']) 59 59 }) 60 60 61 61 it('extracts multiple handles', () => { 62 - const result = extractMentions('cc @alice.bsky.social @bob.example.com') 63 - expect(result).toEqual(['alice.bsky.social', 'bob.example.com']) 62 + const result = extractMentions('cc @jay.bsky.team @alex.example.com') 63 + expect(result).toEqual(['jay.bsky.team', 'alex.example.com']) 64 64 }) 65 65 66 66 it('deduplicates handles (case-insensitive)', () => { 67 - const result = extractMentions('@Alice.Bsky.Social and @alice.bsky.social') 68 - expect(result).toEqual(['alice.bsky.social']) 67 + const result = extractMentions('@Jay.Bsky.Team and @jay.bsky.team') 68 + expect(result).toEqual(['jay.bsky.team']) 69 69 }) 70 70 71 71 it('ignores bare @word without a dot', () => { ··· 303 303 it('resolves handles to DIDs and creates mention notifications', async () => { 304 304 // Select: resolve handles 305 305 const userSelectChain = createChainableProxy([ 306 - { did: 'did:plc:mentioned1', handle: 'alice.bsky.social' }, 306 + { did: 'did:plc:mentioned1', handle: 'jay.bsky.team' }, 307 307 ]) 308 308 mockDb.select.mockReturnValue(userSelectChain) 309 309 ··· 311 311 mockDb.insert.mockReturnValue(insertChain) 312 312 313 313 await service.notifyOnMentions({ 314 - content: 'Hey @alice.bsky.social check this out', 314 + content: 'Hey @jay.bsky.team check this out', 315 315 subjectUri: REPLY_URI, 316 316 actorDid: ACTOR_DID, 317 317 communityDid: COMMUNITY_DID,
+7 -7
tests/unit/services/profile-sync.test.ts
··· 53 53 success: true, 54 54 data: { 55 55 did: TEST_DID, 56 - handle: 'alice.bsky.social', 57 - displayName: 'Alice Wonderland', 56 + handle: 'jay.bsky.team', 57 + displayName: 'Jay', 58 58 avatar: 'https://cdn.bsky.app/img/avatar/plain/did:plc:testuser123456789012/bafkreiabc@jpeg', 59 59 banner: 'https://cdn.bsky.app/img/banner/plain/did:plc:testuser123456789012/bafkreixyz@jpeg', 60 60 description: 'Exploring the decentralized web.', ··· 91 91 success: true, 92 92 data: { 93 93 did: TEST_DID, 94 - handle: 'bob.bsky.social', 94 + handle: 'alex.bsky.team', 95 95 }, 96 96 } 97 97 ··· 125 125 const result = await service.syncProfile(TEST_DID) 126 126 127 127 expect(result).toStrictEqual({ 128 - displayName: 'Alice Wonderland', 128 + displayName: 'Jay', 129 129 avatarUrl: 130 130 'https://cdn.bsky.app/img/avatar/plain/did:plc:testuser123456789012/bafkreiabc@jpeg', 131 131 bannerUrl: ··· 259 259 const result = await service.syncProfile(TEST_DID) 260 260 261 261 expect(result).toStrictEqual({ 262 - displayName: 'Alice Wonderland', 262 + displayName: 'Jay', 263 263 avatarUrl: 264 264 'https://cdn.bsky.app/img/avatar/plain/did:plc:testuser123456789012/bafkreiabc@jpeg', 265 265 bannerUrl: ··· 336 336 success: true, 337 337 data: { 338 338 ...MOCK_PROFILE_RESPONSE.data, 339 - displayName: 'Alice\u200BWonderland', 339 + displayName: 'J\u200Bay', 340 340 }, 341 341 }) 342 342 343 343 const result = await service.syncProfile(TEST_DID) 344 - expect(result.displayName).toBe('AliceWonderland') 344 + expect(result.displayName).toBe('Jay') 345 345 }) 346 346 347 347 it('returns null displayName when name is all control characters', async () => {