diff --git a/src/functional_tests/test_game_my_sea.py b/src/functional_tests/test_game_my_sea.py index 16ca995..fbca23b 100644 --- a/src/functional_tests/test_game_my_sea.py +++ b/src/functional_tests/test_game_my_sea.py @@ -205,8 +205,20 @@ class MySeaDrawSeaLandingTest(FunctionalTest): """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. Element ID `id_draw_sea_btn` describes intent (the draw entry - point) — a future sprint will conditionally swap the label to - DRAW SEA once the daily free has been used.""" + point); the hex-center btn is a 3-way state machine: + - 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.browser.get(self.live_server_url + "/gameboard/my-sea/") # data-phase=landing on the page wrapper @@ -221,6 +233,17 @@ class MySeaDrawSeaLandingTest(FunctionalTest): self.assertIn("FREE", btn.text.upper()) self.assertIn("DRAW", btn.text.upper()) 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 ───────────────────────────────────────────────────────────────