fix(headless): route wire-only chat commands

This commit is contained in:
Erik 2026-08-14 20:47:06 +02:00
parent 41b15efd4d
commit 259f0e5ac3
3 changed files with 219 additions and 0 deletions

View file

@ -54,6 +54,53 @@ public sealed class LiveSessionCommandRouterTests
calls);
}
[Fact]
public void GraphicalRouteKeepsWireOnlyClientCommandParityWithHeadless()
{
var calls = new List<string>();
ClientCommandController.Bindings client = NewClientBindings() with
{
AddPlayerPermission = name =>
calls.Add($"permit:add:{name}"),
RemovePlayerPermission = name =>
calls.Add($"permit:remove:{name}"),
ModifyGlobalSquelch = (add, messageType) =>
calls.Add($"squelch:{add}:{messageType}"),
};
var router = NewRouter(clientBindings: client);
router.Activate();
router.Publish(new ExecuteClientCommandCmd(
ClientCommandId.Permit,
"add Aunt Agatha"));
router.Publish(new ExecuteClientCommandCmd(
ClientCommandId.Permit,
"remove Lord Gnarly Beard"));
router.Publish(new ExecuteClientCommandCmd(
ClientCommandId.ChatToggle,
"on"));
router.Publish(new ExecuteClientCommandCmd(
ClientCommandId.ChatToggle,
"off"));
router.Publish(new ExecuteClientCommandCmd(
ClientCommandId.NoTellToggle,
"on"));
router.Publish(new ExecuteClientCommandCmd(
ClientCommandId.NoTellToggle,
"off"));
Assert.Equal(
[
"permit:add:Aunt Agatha",
"permit:remove:Lord Gnarly Beard",
"squelch:False:2",
"squelch:True:2",
"squelch:True:3",
"squelch:False:3",
],
calls);
}
[Fact]
public void InactiveAndDisposedRouter_CannotReachTransport()
{