From 50baf9d6f1f7d53962abdf00d5440876af20968e Mon Sep 17 00:00:00 2001 From: blindxfish Date: Fri, 21 Aug 2026 00:05:00 +0200 Subject: [PATCH] Fix battles join docs param location and the fight-flow ticker assertion The auth matrix probes documented endpoints with their documented form params; the faction param was declared with location body instead of form, so the anonymous probe sent an empty body and hit 422 validation before the auth guard. And the first fight always triggers a lead-change event that outranks the fight event at the top of the ticker, so the e2e flow now asserts on the ticker as a whole. Co-Authored-By: Claude Fable 5 --- devplacepy/docs_api/groups/battles.py | 2 +- tests/e2e/battles/index.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/devplacepy/docs_api/groups/battles.py b/devplacepy/docs_api/groups/battles.py index bd50f575..b053579c 100644 --- a/devplacepy/docs_api/groups/battles.py +++ b/devplacepy/docs_api/groups/battles.py @@ -125,7 +125,7 @@ coins, ended battle) answers `400` as `{{"error": {{"status": 400, "message": ". encoding="form", params=[ field("uid", "path", "string", True, SAMPLE_WAR["uid"], "Battle uid."), - field("faction", "body", "enum", True, "a", "Which side to join or switch to.", options=["a", "b"]), + field("faction", "form", "enum", True, "a", "Which side to join or switch to.", options=["a", "b"]), ], sample_response={"ok": True, "redirect": SAMPLE_WAR["post_url"], "data": {"war": SAMPLE_WAR}}, ), diff --git a/tests/e2e/battles/index.py b/tests/e2e/battles/index.py index 6a998d4b..2f353345 100644 --- a/tests/e2e/battles/index.py +++ b/tests/e2e/battles/index.py @@ -126,8 +126,7 @@ def test_create_join_and_fight_flow(alice): arg=hp_before, ) expect(card.locator("[data-war-fight]")).to_be_disabled() - ticker_first = card.locator("[data-war-ticker] .war-event").first - expect(ticker_first).to_contain_text("dealt") + expect(card.locator("[data-war-ticker]")).to_contain_text("dealt") def test_switch_faction_shows_confirm(alice):