From c1a391b9f6792dbde6d51d428e3aa563f0637584 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 25 Oct 2026 12:07:57 +0100 Subject: [PATCH] Pinned the clock of the events test in the Website library, so it no longer fails once the demo cons are past. Co-Authored-By: Claude Opus 5.5 --- .../AccountAndCollectingControllerTests.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Services/Website/Tests/Library/Cases/Public/Controllers/AccountAndCollectingControllerTests.swift b/Services/Website/Tests/Library/Cases/Public/Controllers/AccountAndCollectingControllerTests.swift index a21b10a..34413a2 100644 --- a/Services/Website/Tests/Library/Cases/Public/Controllers/AccountAndCollectingControllerTests.swift +++ b/Services/Website/Tests/Library/Cases/Public/Controllers/AccountAndCollectingControllerTests.swift @@ -247,7 +247,11 @@ private extension AccountAndCollectingControllerTests { } /// Runs the body against the session, catalogue, account, and collecting routes, over a migrated, seeded in-memory database. + /// - Parameters: + /// - now: the clock the collecting repository judges upcoming events by; the system's by default. + /// - body: the requests to run against the app. func withApp( + now: @escaping @Sendable () -> Date = { .init() }, _ body: @escaping @Sendable (any TestClientProtocol) async throws -> Void ) async throws { let fluent = try Service( @@ -262,7 +266,7 @@ private extension AccountAndCollectingControllerTests { let accounts = AccountRepository(fluent: fluent) let catalogue = CatalogueRepository(fluent: fluent) - let collecting = CollectingRepository(fluent: fluent) + let collecting = CollectingRepository(fluent: fluent, now: now) let sessions = SessionStore(trade: .init(fluent: fluent), collecting: collecting) let router = Router(context: WebsiteRequestContext.self) @@ -312,7 +316,8 @@ extension AccountAndCollectingControllerTests { @Test func `serves the events, and narrows a search to the copies to pick up at one`() async throws { - try await withApp { client in + // Noon on 22 September 2026 in Amsterdam: every demo con is still to come. + try await withApp(now: { Date(timeIntervalSince1970: 1_790_071_200) }) { client in try await client.execute(uri: "/events", method: .get) { response in let body = String(buffer: response.body)