From e4e3c9190bf8fbbacb8f8ccee47d7047a9f98064 Mon Sep 17 00:00:00 2001 From: Tom Scanlan Date: Sat, 25 Jul 2026 08:21:24 -0400 Subject: [PATCH] test(pagination): keep the tests that can still fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The page-1/load-more continuity tests compared the filter bags two call sites emitted. Both now call one function, so those comparisons assert that a function equals itself: they cannot fail, and a test that cannot fail is upkeep without signal. Remove them and their shared helper. Nothing they covered goes uncovered. Each query's filters, order, bounds and limit stay pinned in events-load-more.test.ts, which drives every registry entry and asserts the exact params it issues. A route calling the wrong query is still caught by the envelope it emits, since a query mints an envelope naming itself — those assertions are kept where the pairings had them. What remains per route is what a route decides: which query it runs, the scope it derives from url/params, whether an inbound ?cursor= may resume, and its own errors. past-events also keeps the still-running exclusion, which shapes results rather than the query. Frozen clocks stay only there, where fixtures depend on one. --- .../src/lib/contrail/continuity.test-utils.ts | 41 --------- .../routes/(app)/events/page.server.test.ts | 52 ++++-------- .../p/[actor]/hosting/page.server.test.ts | 31 +++---- .../p/[actor]/past-events/page.server.test.ts | 47 +++++------ .../routes/(app)/search/page.server.test.ts | 83 ++----------------- .../(app)/topics/[slug]/page.server.test.ts | 55 ++---------- 6 files changed, 64 insertions(+), 245 deletions(-) delete mode 100644 apps/web/src/lib/contrail/continuity.test-utils.ts diff --git a/apps/web/src/lib/contrail/continuity.test-utils.ts b/apps/web/src/lib/contrail/continuity.test-utils.ts deleted file mode 100644 index 7e7608a..0000000 --- a/apps/web/src/lib/contrail/continuity.test-utils.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Shared assertions for the page-1 ↔ load-more continuity tests that sit beside -// each paginated route's +page.server.ts. -import { expect } from 'vitest'; - -/** - * A fixed instant for those tests to run at, so page 1 and the resumer compute - * the same `now()` time bound and it can be compared by value. Install per file: - * - * beforeEach(() => vi.useFakeTimers({ toFake: ['Date'], now: FROZEN_NOW })); - * afterEach(() => vi.useRealTimers()); - * - * Only `Date` is faked, so async control flow is untouched. - */ -export const FROZEN_NOW = new Date('2026-06-01T12:00:00.000Z'); - -/** - * Assert that a route's page-1 `load()` and the load-more resumer continuing it - * issued the SAME query. - * - * A keyset cursor is query-shape-specific, so page 2 is only adjacent to page 1 - * when every other param agrees — sort, order, limit, filters, scope and the - * time bounds. Hence the full param bags are compared rather than a chosen - * subset: a param added to one side only is drift, whether or not this helper - * knows its name. The cursor is the one param that legitimately differs, so it - * is checked separately — page 1 runs fresh, page 2 threads page 1's raw keyset - * through unchanged. - * - * Requires a frozen clock (see FROZEN_NOW). - */ -export function expectSameQuery( - page1: Record, - page2: Record, - rawKeyset: string -): void { - const { cursor: page1Cursor, ...page1Query } = page1; - const { cursor: page2Cursor, ...page2Query } = page2; - - expect(page2Query).toEqual(page1Query); - expect(page1Cursor).toBeUndefined(); - expect(page2Cursor).toBe(rawKeyset); -} diff --git a/apps/web/src/routes/(app)/events/page.server.test.ts b/apps/web/src/routes/(app)/events/page.server.test.ts index 3ac8aa8..c123693 100644 --- a/apps/web/src/routes/(app)/events/page.server.test.ts +++ b/apps/web/src/routes/(app)/events/page.server.test.ts @@ -1,32 +1,28 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, describe, expect, it, vi } from 'vitest'; -// Page 1 of /events comes from this route's load(); page 2 comes from the -// load-more registry's 'events' resumer. They are separate code paths that must -// issue the same discoverable query, so these drive both for real and compare -// what each one emitted. +// What this route decides for /events: which query it runs, the scope it derives +// from ?filter= and records in the emitted envelope, and whether an inbound +// ?cursor= may be resumed. The query body it calls — discoverable, upcoming, asc +// — is pinned in lib/contrail/events-load-more.test.ts. vi.mock('$lib/contrail', () => ({ getServerClient: vi.fn(() => ({})), flattenEventRecords: vi.fn((records: unknown[]) => records), listDiscoverableEventsFromContrail: vi.fn(), listAuthoredEventsFromContrail: vi.fn() })); -// events-load-more.ts imports the search module at load time; the events route -// never hits it, so a null-backend stub keeps the import deterministic. +// queries.ts imports the search module at load time; the events query never hits +// it, so a null-backend stub keeps the import deterministic. vi.mock('$lib/search/server/query', () => ({ searchBackendFromEnv: vi.fn(() => null), runEventSearchPage: vi.fn() })); import { load } from './+page.server'; -import { runLoadMoreEvents } from '$lib/contrail/events-load-more'; import { listDiscoverableEventsFromContrail } from '$lib/contrail'; import { decodeCursor, encodeCursor } from '$lib/contrail/cursor'; -import { FROZEN_NOW, expectSameQuery } from '$lib/contrail/continuity.test-utils'; const mockDiscoverable = vi.mocked(listDiscoverableEventsFromContrail); -const env = { DB: {} } as unknown as App.Platform['env']; - function event(opts?: { filter?: string; cursor?: string }) { const url = new URL('https://atmo.test/events'); if (opts?.filter) url.searchParams.set('filter', opts.filter); @@ -45,50 +41,36 @@ type LoadResult = { events: unknown[]; handles: Record; cursor: const runLoad = async (opts?: { filter?: string; cursor?: string }) => (await load(event(opts))) as LoadResult; -beforeEach(() => vi.useFakeTimers({ toFake: ['Date'], now: FROZEN_NOW })); -afterEach(() => { - vi.useRealTimers(); - vi.clearAllMocks(); -}); +afterEach(() => vi.clearAllMocks()); -describe('events page load ↔ resumer continuity', () => { - it('page-1 load and the events resumer issue the same query (popular)', async () => { +describe('events page load', () => { + // The envelope names the query that minted it, so this also pins that the + // route called the events query and not another one — a mis-wired route would + // emit some other `q` here. + it("mints an 'events' envelope carrying the popular scope", async () => { mockDiscoverable.mockResolvedValue(page('keyset-p1')); const result = await runLoad(); // no filter => popular - const p1 = mockDiscoverable.mock.calls[0][1]; - // The emitted envelope names the same server-side query + scope, carrying the - // fresh keyset for the resumer to thread back in. + expect(mockDiscoverable.mock.calls[0][1]).toMatchObject({ rsvpsCountMin: 2 }); expect(decodeCursor(result.cursor)).toEqual({ v: 1, q: 'events', args: { popular: true }, raw: 'keyset-p1' }); - - await runLoadMoreEvents(env, { cursor: result.cursor! }); - const p2 = mockDiscoverable.mock.calls[1][1]; - - expectSameQuery(p1, p2, 'keyset-p1'); }); - it('page-1 load and the resumer both drop rsvpsCountMin for the all/non-popular filter', async () => { + it('drops rsvpsCountMin for the all/non-popular filter and says so in the envelope', async () => { mockDiscoverable.mockResolvedValue(page('keyset-all')); const result = await runLoad({ filter: 'all' }); - const p1 = mockDiscoverable.mock.calls[0][1]; - expect(p1).not.toHaveProperty('rsvpsCountMin'); + + expect(mockDiscoverable.mock.calls[0][1]).not.toHaveProperty('rsvpsCountMin'); expect(decodeCursor(result.cursor)).toEqual({ v: 1, q: 'events', args: { popular: false }, raw: 'keyset-all' }); - - await runLoadMoreEvents(env, { cursor: result.cursor! }); - const p2 = mockDiscoverable.mock.calls[1][1]; - expect(p2).not.toHaveProperty('rsvpsCountMin'); - - expectSameQuery(p1, p2, 'keyset-all'); }); }); diff --git a/apps/web/src/routes/(app)/p/[actor]/hosting/page.server.test.ts b/apps/web/src/routes/(app)/p/[actor]/hosting/page.server.test.ts index eec5d2e..6a6f304 100644 --- a/apps/web/src/routes/(app)/p/[actor]/hosting/page.server.test.ts +++ b/apps/web/src/routes/(app)/p/[actor]/hosting/page.server.test.ts @@ -1,9 +1,9 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, describe, expect, it, vi } from 'vitest'; -// Page 1 of /p/[actor]/hosting comes from this route's load(); page 2 comes from -// the load-more registry's 'hosting' resumer. They are separate code paths that -// must issue the same authored + upcoming query, scoped to the same actor, so -// these drive both for real and compare what each one emitted. +// What this route decides for /p/[actor]/hosting: which query it runs, the actor +// scope it records in the emitted envelope, and whether an inbound ?cursor= may +// be resumed. The query body — authored, upcoming, asc — is pinned in +// lib/contrail/events-load-more.test.ts. vi.mock('$lib/actor', () => ({ getActor: vi.fn(async () => 'did:plc:alice') })); @@ -20,15 +20,12 @@ vi.mock('$lib/search/server/query', () => ({ })); import { load } from './+page.server'; -import { runLoadMoreEvents } from '$lib/contrail/events-load-more'; import { listAuthoredEventsFromContrail } from '$lib/contrail'; import { decodeCursor, encodeCursor } from '$lib/contrail/cursor'; -import { FROZEN_NOW, expectSameQuery } from '$lib/contrail/continuity.test-utils'; const mockAuthored = vi.mocked(listAuthoredEventsFromContrail); const ACTOR = 'did:plc:alice'; -const env = { DB: {} } as unknown as App.Platform['env']; function event(actor: string, cursor?: string) { const url = new URL(`https://atmo.test/p/${actor}/hosting`); @@ -51,17 +48,14 @@ type LoadResult = { events: unknown[]; cursor: string | null }; const runLoad = async (actor: string, cursor?: string) => (await load(event(actor, cursor))) as LoadResult; -beforeEach(() => vi.useFakeTimers({ toFake: ['Date'], now: FROZEN_NOW })); -afterEach(() => { - vi.useRealTimers(); - vi.clearAllMocks(); -}); +afterEach(() => vi.clearAllMocks()); -describe('hosting page load ↔ resumer continuity', () => { - it('page-1 load and the hosting resumer issue the same query', async () => { +describe('hosting page load', () => { + // The envelope names the query that minted it, so this also pins that the + // route called the hosting query — the past-events one would say so here. + it("mints a 'hosting' envelope scoped to this actor", async () => { mockAuthored.mockResolvedValue(page('keyset-p1')); const result = await runLoad(ACTOR); - const p1 = mockAuthored.mock.calls[0][1]; expect(decodeCursor(result.cursor)).toEqual({ v: 1, @@ -69,11 +63,6 @@ describe('hosting page load ↔ resumer continuity', () => { args: { actor: ACTOR }, raw: 'keyset-p1' }); - - await runLoadMoreEvents(env, { cursor: result.cursor! }); - const p2 = mockAuthored.mock.calls[1][1]; - - expectSameQuery(p1, p2, 'keyset-p1'); }); }); diff --git a/apps/web/src/routes/(app)/p/[actor]/past-events/page.server.test.ts b/apps/web/src/routes/(app)/p/[actor]/past-events/page.server.test.ts index 5d32006..b88b30b 100644 --- a/apps/web/src/routes/(app)/p/[actor]/past-events/page.server.test.ts +++ b/apps/web/src/routes/(app)/p/[actor]/past-events/page.server.test.ts @@ -1,10 +1,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -// Page 1 of /p/[actor]/past-events comes from this route's load(); page 2 comes -// from the load-more registry's 'past-events' resumer. They are separate code -// paths that must issue the same authored + past query — desc order under a -// startsAtMax upper bound, not startsAtMin — so these drive both for real and -// compare what each one emitted. +// What this route decides for /p/[actor]/past-events: which query it runs, the +// actor scope it records in the emitted envelope, and whether an inbound ?cursor= +// may be resumed. Plus the one result-shaping rule that is easy to get wrong — +// the upper time bound admits an event that is still running, so the query +// excludes it. vi.mock('$lib/actor', () => ({ getActor: vi.fn(async () => 'did:plc:alice') })); @@ -21,15 +21,14 @@ vi.mock('$lib/search/server/query', () => ({ })); import { load } from './+page.server'; -import { runLoadMoreEvents } from '$lib/contrail/events-load-more'; import { listAuthoredEventsFromContrail } from '$lib/contrail'; import { decodeCursor, encodeCursor } from '$lib/contrail/cursor'; -import { FROZEN_NOW, expectSameQuery } from '$lib/contrail/continuity.test-utils'; const mockAuthored = vi.mocked(listAuthoredEventsFromContrail); +// Frozen so ENDED/ONGOING sit deterministically either side of "now". +const FROZEN_NOW = new Date('2026-06-01T12:00:00.000Z'); const ACTOR = 'did:plc:alice'; -const env = { DB: {} } as unknown as App.Platform['env']; function event(actor: string, cursor?: string) { const url = new URL(`https://atmo.test/p/${actor}/past-events`); @@ -46,8 +45,8 @@ const ENDED = { uri: 'at://did:plc:alice/community.lexicon.calendar.event/1', startsAt: '2000-01-01T00:00:00Z' }; -// Began before the frozen clock but has NOT finished. The startsAtMax bound -// admits it, so both sides have to exclude it themselves. +// Began before the frozen clock but has NOT finished; the startsAtMax bound +// admits it, so the query has to exclude it. const ONGOING = { uri: 'at://did:plc:alice/community.lexicon.calendar.event/ongoing', startsAt: '2000-01-01T00:00:00Z', @@ -71,13 +70,14 @@ afterEach(() => { vi.clearAllMocks(); }); -describe('past-events page load ↔ resumer continuity', () => { - it('page-1 load and the past-events resumer issue the same query (desc, startsAtMax)', async () => { +describe('past-events page load', () => { + it("mints a 'past-events' envelope, bounded ABOVE by now", async () => { mockAuthored.mockResolvedValue(page('keyset-p1')); const result = await runLoad(ACTOR); - const p1 = mockAuthored.mock.calls[0][1]; - // The past query is bounded ABOVE by now, not below — the one route where + + // The past query is bounded above by now, not below — the one route where // swapping the bound would still look plausible. + const p1 = mockAuthored.mock.calls[0][1]; expect(typeof p1.startsAtMax).toBe('string'); expect(p1.startsAtMin).toBeUndefined(); expect(p1.order).toBe('desc'); @@ -88,25 +88,18 @@ describe('past-events page load ↔ resumer continuity', () => { args: { actor: ACTOR }, raw: 'keyset-p1' }); - - await runLoadMoreEvents(env, { cursor: result.cursor! }); - const p2 = mockAuthored.mock.calls[1][1]; - - expectSameQuery(p1, p2, 'keyset-p1'); }); - // Matching query bags are not enough here: this route also narrows the - // RESULT after the query returns. If only page 1 did that, an event that is - // still running would be filtered off page 1 and then resurface on page 2 of - // "past events". - it('page-1 load and the resumer both exclude an event that is still running', async () => { + // startsAtMax admits an event that began earlier and is still running, so the + // query narrows the result after the read. Every page inherits that narrowing + // because there is one query — an ongoing event cannot be dropped from one + // page and resurface on the next. + it('excludes an event that is still running', async () => { mockAuthored.mockResolvedValue(page('keyset-p1', [ONGOING, ENDED])); const result = await runLoad(ACTOR); - expect(result.events).toEqual([ENDED]); - const page2 = await runLoadMoreEvents(env, { cursor: result.cursor! }); - expect(page2.events).toEqual([ENDED]); + expect(result.events).toEqual([ENDED]); }); }); diff --git a/apps/web/src/routes/(app)/search/page.server.test.ts b/apps/web/src/routes/(app)/search/page.server.test.ts index 2a10ecc..9f6fbe4 100644 --- a/apps/web/src/routes/(app)/search/page.server.test.ts +++ b/apps/web/src/routes/(app)/search/page.server.test.ts @@ -1,11 +1,11 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; - -// The search load picks between two backends whose cursors are NOT -// interchangeable: Meilisearch (offset cursor) and the D1 LIKE fallback (opaque -// keyset). Each hands back a self-describing continuation envelope naming its -// own query, so load-more resumes on the backend that produced the page. These -// pin the page-1 behaviour, the deep-link guard, and — for both backends — that -// page 1 and its resumer issue the same query. +import { afterEach, describe, expect, it, vi } from 'vitest'; + +// The one route that picks between two backends whose cursors are NOT +// interchangeable: Meilisearch (offset) and the D1 LIKE fallback (opaque keyset). +// Only page 1 may fall back — a continuation must not switch backends — so these +// pin which backend serves the page, that the emitted envelope names it, and that +// no inbound ?cursor= is ever resumed here (the term rides ?q=, not the +// envelope). vi.mock('$lib/contrail', () => ({ getServerClient: vi.fn(() => ({})), flattenEventRecords: vi.fn((records: unknown[]) => records), @@ -17,18 +17,14 @@ vi.mock('$lib/search/server/query', () => ({ })); import { load } from './+page.server'; -import { runLoadMoreEvents } from '$lib/contrail/events-load-more'; import { listDiscoverableEventsFromContrail } from '$lib/contrail'; import { runEventSearchPage, searchBackendFromEnv } from '$lib/search/server/query'; import { decodeCursor, encodeCursor } from '$lib/contrail/cursor'; -import { FROZEN_NOW, expectSameQuery } from '$lib/contrail/continuity.test-utils'; const mockSearchBackendFromEnv = vi.mocked(searchBackendFromEnv); const mockRunEventSearchPage = vi.mocked(runEventSearchPage); const mockListDiscoverable = vi.mocked(listDiscoverableEventsFromContrail); -const env = { DB: {} } as unknown as App.Platform['env']; - type LoadResult = { events: unknown[]; handles: Record; @@ -47,11 +43,7 @@ function event(q: string, cursor?: string) { return { url, platform: { env: {} } } as unknown as Parameters[0]; } -beforeEach(() => vi.useFakeTimers({ toFake: ['Date'], now: FROZEN_NOW })); -afterEach(() => { - vi.useRealTimers(); - vi.clearAllMocks(); -}); +afterEach(() => vi.clearAllMocks()); describe('search page load', () => { it('returns early for an empty query without touching any backend', async () => { @@ -158,60 +150,3 @@ describe('search page load', () => { expect(mockListDiscoverable.mock.calls[0][1].cursor).toBeUndefined(); }); }); - -// Unlike the other routes the search term rides ?q=/input, NOT the envelope, so -// the resumer must be HANDED the term to reproduce page 1. These pin that once -// it is, the page-1 load and the resumer issue the same query — on whichever of -// the two backends served page 1. -describe('search page load ↔ resumer continuity', () => { - it('page-1 D1 fallback and the search-d1 resumer issue the same query', async () => { - mockSearchBackendFromEnv.mockReturnValue(null); - mockListDiscoverable.mockResolvedValue({ - records: [{ uri: 'at://did:plc:a/community.lexicon.calendar.event/1' }], - profiles: [{ did: 'did:plc:a', handle: 'alice' }], - cursor: 'keyset-p1' - } as unknown as Awaited>); - - const result = await runLoad('kite'); - const p1 = mockListDiscoverable.mock.calls[0][1]; - expect(decodeCursor(result.cursor)).toEqual({ v: 1, q: 'search-d1', raw: 'keyset-p1' }); - - // The term is absent from the envelope; the client re-supplies it as `q`. - await runLoadMoreEvents(env, { cursor: result.cursor!, q: 'kite' }); - const p2 = mockListDiscoverable.mock.calls[1][1]; - - expectSameQuery(p1, p2, 'keyset-p1'); - }); - - it('page-1 Meili and the search-meili resumer issue the same query, threading the raw offset', async () => { - mockSearchBackendFromEnv.mockReturnValue({ url: 'https://meili.test', apiKey: 'k' }); - mockRunEventSearchPage.mockResolvedValue({ - events: [{ uri: 'at://did:plc:a/community.lexicon.calendar.event/1' }], - handles: { 'did:plc:a': 'alice' }, - cursor: 'meili:20', - distances: {} - } as unknown as Awaited>); - - const result = await runLoad('kite'); - expect(decodeCursor(result.cursor)).toEqual({ v: 1, q: 'search-meili', raw: 'meili:20' }); - - await runLoadMoreEvents(env, { cursor: result.cursor!, q: 'kite' }); - - // Compare the whole options object both sides passed, not just `q` — an - // option added to the page-1 call alone (a filter, a page size, a locale) - // would search a different result set on page 2. - const p1 = mockRunEventSearchPage.mock.calls[0][2]; - const p2 = mockRunEventSearchPage.mock.calls[1][2]; - expectSameQuery(p1, p2, 'meili:20'); - - // The backend is part of the query's identity too — it carries the index - // being searched, so an offset from one index is meaningless against - // another. This is outside the options bag, so it needs its own pin. - expect(mockRunEventSearchPage.mock.calls[1][0]).toEqual( - mockRunEventSearchPage.mock.calls[0][0] - ); - - expect(p1.q).toBe('kite'); - expect(mockListDiscoverable).not.toHaveBeenCalled(); // never the D1 path - }); -}); diff --git a/apps/web/src/routes/(app)/topics/[slug]/page.server.test.ts b/apps/web/src/routes/(app)/topics/[slug]/page.server.test.ts index 1ccc20a..8e9ed9c 100644 --- a/apps/web/src/routes/(app)/topics/[slug]/page.server.test.ts +++ b/apps/web/src/routes/(app)/topics/[slug]/page.server.test.ts @@ -1,34 +1,28 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, describe, expect, it, vi } from 'vitest'; -// Page 1 of /topics/[slug] comes from this route's load(); page 2 comes from the -// load-more registry's 'topic' resumer. Both derive the OR-search from the slug -// server-side, and both must issue the same discoverable query, so these drive -// both for real and compare what each one emitted — plus the deep-link guard. +// What this route decides for /topics/[slug]: the 404 for an unknown slug, which +// query it runs, the slug it records in the emitted envelope, and whether an +// inbound ?cursor= may be resumed. $lib/topics is left REAL so the OR-search is +// derived from the slug for real rather than stubbed. vi.mock('$lib/contrail', () => ({ getServerClient: vi.fn(() => ({})), flattenEventRecords: vi.fn((records: unknown[]) => records), listDiscoverableEventsFromContrail: vi.fn(), listAuthoredEventsFromContrail: vi.fn() })); -// events-load-more.ts imports the search module at load time; the topic query -// never hits it, so a null-backend stub keeps the import deterministic. $lib/topics -// is intentionally left REAL so orQueryFromSlug derives the same OR-search on both -// the page-1 and resumer sides. +// queries.ts imports the search module at load time; the topic query never hits +// it, so a null-backend stub keeps the import deterministic. vi.mock('$lib/search/server/query', () => ({ searchBackendFromEnv: vi.fn(() => null), runEventSearchPage: vi.fn() })); import { load } from './+page.server'; -import { runLoadMoreEvents } from '$lib/contrail/events-load-more'; import { listDiscoverableEventsFromContrail } from '$lib/contrail'; import { decodeCursor, encodeCursor } from '$lib/contrail/cursor'; -import { FROZEN_NOW, expectSameQuery } from '$lib/contrail/continuity.test-utils'; const mockListDiscoverable = vi.mocked(listDiscoverableEventsFromContrail); -const env = { DB: {} } as unknown as App.Platform['env']; - type LoadResult = { topic: { slug: string }; events: unknown[]; @@ -46,11 +40,7 @@ function event(slug: string, cursor?: string) { const run = async (slug: string, cursor?: string) => (await load(event(slug, cursor))) as unknown as LoadResult; -beforeEach(() => vi.useFakeTimers({ toFake: ['Date'], now: FROZEN_NOW })); -afterEach(() => { - vi.useRealTimers(); - vi.clearAllMocks(); -}); +afterEach(() => vi.clearAllMocks()); describe('topic page load', () => { it("builds a 'topic' envelope carrying the slug, deriving the OR-search server-side", async () => { @@ -139,32 +129,3 @@ describe('topic page load', () => { expect(mockListDiscoverable).not.toHaveBeenCalled(); }); }); - -describe('topic page load ↔ resumer continuity', () => { - it('page-1 load and the topic resumer issue the same query (same OR-search)', async () => { - mockListDiscoverable.mockResolvedValue({ - records: [{ uri: 'at://did:plc:a/community.lexicon.calendar.event/1' }], - profiles: [{ did: 'did:plc:a', handle: 'alice' }], - cursor: 'keyset-p1' - } as unknown as Awaited>); - - const result = await run('technology'); - const p1 = mockListDiscoverable.mock.calls[0][1]; - // Page 1 derives the OR-search server-side from the slug. - expect(p1.search).toBe('tech OR technology'); - expect(decodeCursor(result.cursor)).toEqual({ - v: 1, - q: 'topic', - args: { slug: 'technology' }, - raw: 'keyset-p1' - }); - - await runLoadMoreEvents(env, { cursor: result.cursor! }); - const p2 = mockListDiscoverable.mock.calls[1][1]; - - // The comparison covers `search`, so it also pins that the resumer re-derived - // the SAME 'tech OR technology' from the slug rather than trusting a client - // value or drifting to another spelling of the query. - expectSameQuery(p1, p2, 'keyset-p1'); - }); -}); -- 2.51.2