From bafbf84e19f3ef3954159d70f144d1dee1bf4a60 Mon Sep 17 00:00:00 2001 From: Heimdall Date: Thu, 12 Nov 2026 10:21:01 +0000 Subject: [PATCH] Desk tests: after #71, the production door registers by default and the card is opaque Co-Authored-By: Claude Sonnet 5.5 --- tests/Bifrost.Web.Tests/DeskCredentialTests.cs | 2 +- tests/Bifrost.Web.Tests/DeskReadTests.cs | 2 +- tests/Bifrost.Web.Tests/DeskSurfaceTests.cs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Bifrost.Web.Tests/DeskCredentialTests.cs b/tests/Bifrost.Web.Tests/DeskCredentialTests.cs index 8a10318..8476c87 100644 --- a/tests/Bifrost.Web.Tests/DeskCredentialTests.cs +++ b/tests/Bifrost.Web.Tests/DeskCredentialTests.cs @@ -259,7 +259,7 @@ public sealed class DeskCredentialTests : IDisposable const string secretAnswerer = "0badc0de-0000-4000-8000-00000000000d"; // not on any decider list, so no card carries it var entry = DeskReplay.Entry(DeskReplay.Card(DeskReplay.ChatFork)); var answer = new DeskAnswerDocument( - DeskSchemas.DeskAnswer, "n1", DeskReplay.ChatFork, "Counted", null, null, null, entry.Card.OptionsHash, "a", "private words", + DeskSchemas.DeskAnswer, "n1", DeskReplay.ChatFork, "Counted", null, null, null, entry.Card.GetProperty("options_hash").GetString(), "a", "private words", "2026-11-12T19:00:00Z", "2026-11-12T19:00:01Z", false, secretAnswerer, "Steward", "r-1"); entry = entry with { Record = entry.Record with { Answers = [answer] } }; factory.Door.ListScript = (_, r) => new DeskListOutcome.Listed(new ForkList("gamecult.fork.list.v0", r.Mind, "s1", 1, 0, [entry], null)); diff --git a/tests/Bifrost.Web.Tests/DeskReadTests.cs b/tests/Bifrost.Web.Tests/DeskReadTests.cs index 70d849c..027d7da 100644 --- a/tests/Bifrost.Web.Tests/DeskReadTests.cs +++ b/tests/Bifrost.Web.Tests/DeskReadTests.cs @@ -430,7 +430,7 @@ public sealed class DeskReadTests foreach (var account in new[] { DeskWebApplicationFactory.Member, DeskWebApplicationFactory.Alice }) { var reply = await factory.SendAsync("GET", "/api/desk/gamecult-chat/forks", null, factory.Token(account, "bifrost-desk", "desk.read")); - Assert.Equal(forks.Select(f => f.Card.ForkId), JsonNode.Parse(reply.Body)!["forks"]!.AsArray().Select(f => (string?)f!["card"]!["fork_id"])); + Assert.Equal(forks.Select(f => f.Card.GetProperty("fork_id").GetString()), JsonNode.Parse(reply.Body)!["forks"]!.AsArray().Select(f => (string?)f!["card"]!["fork_id"])); } } diff --git a/tests/Bifrost.Web.Tests/DeskSurfaceTests.cs b/tests/Bifrost.Web.Tests/DeskSurfaceTests.cs index b4dbc56..b0da228 100644 --- a/tests/Bifrost.Web.Tests/DeskSurfaceTests.cs +++ b/tests/Bifrost.Web.Tests/DeskSurfaceTests.cs @@ -36,14 +36,14 @@ public sealed class DeskSurfaceTests } [Fact] - public void A_configured_desk_without_its_door_stops_startup() + public void A_configured_desk_with_no_door_supplied_gets_the_production_unix_socket_door() { using var factory = new DeskWebApplicationFactory(registerPorts: false); - var failure = Assert.ThrowsAny(() => factory.CreateClient()); + factory.CreateClient(); - // The credential is production wiring (OpenIddict validation); the door is the port a test or Huginn supplies. - Assert.Contains("IDeskDoor", failure.ToString()); + // The credential is production wiring (OpenIddict validation) and so is the door; a test supplies a fake only by replacing it. + Assert.IsType(factory.Services.GetRequiredService()); } [Fact]