test(client): cover non-companion disposition routing (§6/§7 boundary) in NewGame

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-09 14:42:12 -05:00
parent 8ca89a1ab2
commit 7c5eaf3ba3

View File

@@ -85,3 +85,16 @@ func test_unresolved_origin_is_rejected():
var res := NewGame.construct(o, world, {"name": "X", "class_id": "sellsword"}, _rng())
assert_false(res["ok"])
assert_true("unresolved ref: location:nowhere" in res["errors"])
func test_non_companion_override_goes_to_state_not_log():
world.npcs["oda_fenn"] = {"id": "oda_fenn", "name": "Oda Fenn", "role": "npc"}
var o := _deserter()
o["disposition_overrides"] = {"brannoc_thane": 40, "oda_fenn": -25}
var res := NewGame.construct(o, world, {"name": "X", "class_id": "sellsword"}, _rng())
assert_true(res["ok"], str(res["errors"]))
assert_eq(res["state"].npc_dispositions["oda_fenn"], -25)
assert_null(res["log"].party_member("oda_fenn"))
for m in res["log"].to_dict()["party"]:
assert_ne(m["id"], "oda_fenn")
assert_eq(res["log"].party_member("brannoc_thane").disposition, 40)