my-sea hex-btn state-machine FT pin: extend test_landing_renders_hex_with_free_draw_btn to assert PAID DRAW + GATE VIEW are absent for fresh users — closes the mutual-exclusion gap (the other two states already pin the same invariant from their own directions; this adds the FREE-DRAW side). Docstring spells out the 3-way state machine for future readers
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -205,8 +205,20 @@ class MySeaDrawSeaLandingTest(FunctionalTest):
|
|||||||
"""User w. sig → /gameboard/my-sea/ shows the DRY table hex (re-
|
"""User w. sig → /gameboard/my-sea/ shows the DRY table hex (re-
|
||||||
used from my-sign / the room shell) w. a central FREE DRAW btn.
|
used from my-sign / the room shell) w. a central FREE DRAW btn.
|
||||||
Element ID `id_draw_sea_btn` describes intent (the draw entry
|
Element ID `id_draw_sea_btn` describes intent (the draw entry
|
||||||
point) — a future sprint will conditionally swap the label to
|
point); the hex-center btn is a 3-way state machine:
|
||||||
DRAW SEA once the daily free has been used."""
|
- FREE DRAW (`#id_draw_sea_btn`) — fresh user (no active row, no
|
||||||
|
deposit). Pinned here.
|
||||||
|
- PAID DRAW (`#id_my_sea_paid_draw_btn`) — deposit reserved.
|
||||||
|
Pinned by `MySeaLandingPaidDrawTest`.
|
||||||
|
- GATE VIEW (`#id_my_sea_gate_view_btn`) — quota spent, no
|
||||||
|
deposit (post-DEL). Pinned by
|
||||||
|
`MySeaDeleteDrawAndGuardPortalTest` (the DEL-confirm flow).
|
||||||
|
|
||||||
|
The three IDs are mutually exclusive — only one renders at a
|
||||||
|
time. This test pins the fresh-user side of that exclusion
|
||||||
|
(FREE DRAW present, the other two absent); the deposit + post-
|
||||||
|
DEL sides have their own dedicated FTs that pin the same
|
||||||
|
invariant from the other directions."""
|
||||||
self.create_pre_authenticated_session(self.email)
|
self.create_pre_authenticated_session(self.email)
|
||||||
self.browser.get(self.live_server_url + "/gameboard/my-sea/")
|
self.browser.get(self.live_server_url + "/gameboard/my-sea/")
|
||||||
# data-phase=landing on the page wrapper
|
# data-phase=landing on the page wrapper
|
||||||
@@ -221,6 +233,17 @@ class MySeaDrawSeaLandingTest(FunctionalTest):
|
|||||||
self.assertIn("FREE", btn.text.upper())
|
self.assertIn("FREE", btn.text.upper())
|
||||||
self.assertIn("DRAW", btn.text.upper())
|
self.assertIn("DRAW", btn.text.upper())
|
||||||
self.assertIn("btn-primary", btn.get_attribute("class"))
|
self.assertIn("btn-primary", btn.get_attribute("class"))
|
||||||
|
# Mutual exclusion: PAID DRAW + GATE VIEW must NOT also render.
|
||||||
|
self.assertEqual(
|
||||||
|
len(page.find_elements(By.CSS_SELECTOR, "#id_my_sea_paid_draw_btn")),
|
||||||
|
0,
|
||||||
|
"PAID DRAW btn must not render when no deposit is reserved",
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
len(page.find_elements(By.CSS_SELECTOR, "#id_my_sea_gate_view_btn")),
|
||||||
|
0,
|
||||||
|
"GATE VIEW btn must not render when no active draw row exists",
|
||||||
|
)
|
||||||
|
|
||||||
# ── Test 2 ───────────────────────────────────────────────────────────────
|
# ── Test 2 ───────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user