Desk tests: after #71, the production door registers by default and the card is opaque
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0a1563f3b4
commit
bafbf84e19
3 changed files with 6 additions and 6 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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"]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Exception>(() => 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<UnixSocketDeskDoor>(factory.Services.GetRequiredService<IDeskDoor>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Reference in a new issue