See the best posts from any Bluesky account
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix stale test assertions and mock real Bluesky API calls in tests

Update loading page assertions to match the custom div-based progressbar
(role="progressbar" + aria-valuemax) instead of the removed <progress>
element. Fix backfilled-user test to expect the render-path getProfile
call. Add AtprotoClient swaps to all ClickHouse-backed profile tests
that were hitting the live Bluesky AppView API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+30 -5
+27 -2
tests/functional/profile_controller.spec.ts
··· 173 173 assert.include(html, 'meta http-equiv="refresh"') 174 174 assert.include(html, 'Indexing') 175 175 // Task 4: live SSE-driven progress bar with Alpine component 176 - assert.include(html, '<progress') 176 + assert.include(html, 'role="progressbar"') 177 177 assert.include(html, 'x-data="backfillProgress(') 178 - assert.include(html, 'max="42"') 178 + assert.include(html, 'aria-valuemax="42"') 179 179 }) 180 180 181 181 // Test 17: GET /profile/:handle preserves ?days= when redirecting to canonical /likes ··· 284 284 }) => { 285 285 // Swap the container ClickHouseStore with our test instance 286 286 swap(ClickHouseStore, store) 287 + swap(AtprotoClient, { 288 + async getProfile() { 289 + return { displayName: 'dril', avatarUrl: null } 290 + }, 291 + } as unknown as AtprotoClient) 287 292 288 293 await User.create({ 289 294 did: 'did:plc:test001', ··· 325 330 swap, 326 331 }) => { 327 332 swap(ClickHouseStore, store) 333 + swap(AtprotoClient, { 334 + async getProfile() { 335 + return { displayName: 'dril', avatarUrl: null } 336 + }, 337 + } as unknown as AtprotoClient) 328 338 329 339 await User.create({ 330 340 did: 'did:plc:test002', ··· 376 386 // Test 20: profile page emits <link rel="canonical"> 377 387 test('profile page emits <link rel="canonical">', async ({ client, assert, swap }) => { 378 388 swap(ClickHouseStore, store) 389 + swap(AtprotoClient, { 390 + async getProfile() { 391 + return { displayName: null, avatarUrl: null } 392 + }, 393 + } as unknown as AtprotoClient) 379 394 380 395 await User.create({ 381 396 did: 'did:plc:canonical001', ··· 395 410 // Test 21: canonical URL includes ?days= when set 396 411 test('canonical URL includes ?days= when set', async ({ client, assert, swap }) => { 397 412 swap(ClickHouseStore, store) 413 + swap(AtprotoClient, { 414 + async getProfile() { 415 + return { displayName: null, avatarUrl: null } 416 + }, 417 + } as unknown as AtprotoClient) 398 418 399 419 await User.create({ 400 420 did: 'did:plc:canonical002', ··· 418 438 swap, 419 439 }) => { 420 440 swap(ClickHouseStore, store) 441 + swap(AtprotoClient, { 442 + async getProfile() { 443 + return { displayName: null, avatarUrl: null } 444 + }, 445 + } as unknown as AtprotoClient) 421 446 422 447 await User.create({ 423 448 did: 'did:plc:test003',
+3 -3
tests/functional/profile_controller_dispatch.spec.ts
··· 106 106 assert.include(response.text(), 'meta http-equiv="refresh"') 107 107 // Alpine `backfillProgress` component is wired with the fetched totalPosts 108 108 assert.include(response.text(), 'total: 1234') 109 - assert.include(response.text(), '<progress') 109 + assert.include(response.text(), 'role="progressbar"') 110 110 111 111 // User row created 112 112 const user = await User.findBy('handle', TEST_HANDLE) ··· 407 407 response.assertStatus(200) 408 408 assert.notInclude(response.text(), 'meta http-equiv="refresh"') 409 409 410 - // No dispatch and no getProfile call 410 + // No dispatch — but getProfile is called once in the render path for live profile data 411 411 queue.fake().assertNothingPushed() 412 - assert.equal(fakeAtproto.getProfileCalls, 0) 412 + assert.equal(fakeAtproto.getProfileCalls, 1) 413 413 }) 414 414 })