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 <noreply@anthropic.com>
This commit is contained in:
1 parent
911424de24
commit
c1a391b9f6
1 file changed
+7
-2
+7
-2
@@ -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.
|
/// 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(
|
func withApp(
|
||||||
|
now: @escaping @Sendable () -> Date = { .init() },
|
||||||
_ body: @escaping @Sendable (any TestClientProtocol) async throws -> Void
|
_ body: @escaping @Sendable (any TestClientProtocol) async throws -> Void
|
||||||
) async throws {
|
) async throws {
|
||||||
let fluent = try Service(
|
let fluent = try Service(
|
||||||
@@ -262,7 +266,7 @@ private extension AccountAndCollectingControllerTests {
|
|||||||
|
|
||||||
let accounts = AccountRepository(fluent: fluent)
|
let accounts = AccountRepository(fluent: fluent)
|
||||||
let catalogue = CatalogueRepository(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 sessions = SessionStore(trade: .init(fluent: fluent), collecting: collecting)
|
||||||
let router = Router(context: WebsiteRequestContext.self)
|
let router = Router(context: WebsiteRequestContext.self)
|
||||||
|
|
||||||
@@ -312,7 +316,8 @@ extension AccountAndCollectingControllerTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
func `serves the events, and narrows a search to the copies to pick up at one`() async throws {
|
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
|
try await client.execute(uri: "/events", method: .get) { response in
|
||||||
let body = String(buffer: response.body)
|
let body = String(buffer: response.body)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user