Fix battles join docs param location and the fight-flow ticker assertion
Some checks failed
DevPlace CI / test (pull_request) Has been cancelled

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 <noreply@anthropic.com>
This commit is contained in:
blindxfish 2026-08-21 00:05:00 +02:00
parent 80956ce0f4
commit 50baf9d6f1
2 changed files with 2 additions and 3 deletions

View File

@ -125,7 +125,7 @@ coins, ended battle) answers `400` as `{{"error": {{"status": 400, "message": ".
encoding="form", encoding="form",
params=[ params=[
field("uid", "path", "string", True, SAMPLE_WAR["uid"], "Battle uid."), 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}}, sample_response={"ok": True, "redirect": SAMPLE_WAR["post_url"], "data": {"war": SAMPLE_WAR}},
), ),

View File

@ -126,8 +126,7 @@ def test_create_join_and_fight_flow(alice):
arg=hp_before, arg=hp_before,
) )
expect(card.locator("[data-war-fight]")).to_be_disabled() expect(card.locator("[data-war-fight]")).to_be_disabled()
ticker_first = card.locator("[data-war-ticker] .war-event").first expect(card.locator("[data-war-ticker]")).to_contain_text("dealt")
expect(ticker_first).to_contain_text("dealt")
def test_switch_faction_shows_confirm(alice): def test_switch_faction_shows_confirm(alice):