From a0ded7f09bb82ec7d1d444a2fdb1fe84770fffd3 Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Mon, 8 Jun 2026 02:00:47 -0400 Subject: [PATCH] =?UTF-8?q?Sea=20Select=20FTs:=20drop=20the=20removed-LOCK?= =?UTF-8?q?-HAND=20tests=20+=20reveal=20the=20cross=20before=20stack=20int?= =?UTF-8?q?eraction=20=E2=80=94=20TDD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 06-07 modal→felt scroll-snap refactor dropped LOCK HAND (→ AUTO DRAW + auto-completion on the 6th draw) and moved the deck stacks into the cross-col (`.sea-page--room:not(.sea-spread-chosen) .sea-cross-col{display:none}`), but the channels `PickSeaDealTest` was never updated → 3 reds in the two-browser/channels CI stage: • test_lock_hand_btn_present_and_disabled + test_lock_hand_enables_after_six_draws — looked up the removed `id_sea_lock_hand` (NoSuchElement). • test_clicking_stack_shows_ok_btn — the stack OK is hidden until a spread is OK'd. Fix: deleted the disabled-LOCK-HAND test; rewrote the six-draws test to assert the new synchronous completion (the deck-stack FLIP btns gain `.btn-disabled` the instant the 6th card lands, before the 3s felt cascade — SEED MAP is IT-covered); added a `_choose_spread()` helper (clicks `id_sea_confirm_spread`) so the stack-interaction tests run against the revealed cross page. Pre-existing 06-07 staleness — NOT tonight's glow/swap/applet commits (verified: `_load_sea_overlay` opens the sea felt with no sky felt open, so the new swap guard is a no-op). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../test_game_room_select_sea.py | 57 +++++++++++++------ 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/src/functional_tests/test_game_room_select_sea.py b/src/functional_tests/test_game_room_select_sea.py index 0455c99..5cf0ac9 100644 --- a/src/functional_tests/test_game_room_select_sea.py +++ b/src/functional_tests/test_game_room_select_sea.py @@ -209,7 +209,13 @@ def _make_sea_ready_room(earthman): @tag("channels") class PickSeaDealTest(ChannelsFunctionalTest): - """DRAW SEA deck stacks, OK btn interaction, card draw, and LOCK HAND.""" + """DRAW SEA deck stacks, OK btn interaction, card draw, and completion. + + Post-06-07 the felt opens on the spread OPTIONS page; OK'ing the spread + (`id_sea_confirm_spread`) adds `sea-spread-chosen` → the cross page is + revealed (the deck stacks live there, `display:none` until then). LOCK HAND + was dropped: AUTO DRAW + auto-completion on the 6th draw replaced it (no + discrete lock btn — see the `PickSeaUnifiedFeltTest` ITs for SEED MAP).""" def setUp(self): super().setUp() @@ -244,21 +250,28 @@ class PickSeaDealTest(ChannelsFunctionalTest): self.browser.execute_script("arguments[0].click()", btn) self.wait_for(lambda: self.browser.find_element(By.ID, "id_sea_overlay")) + def _choose_spread(self): + """OK the default spread → reveal the cross page (the deck stacks). + + The felt opens on the OPTIONS page; the deck stacks live in + `.sea-cross-col`, which is `display:none` until OK adds + `sea-spread-chosen` (see `_sky.scss`). Tests that interact with a stack + must choose a spread first.""" + ok = self.wait_for( + lambda: self.browser.find_element(By.ID, "id_sea_confirm_spread") + ) + self.browser.execute_script("arguments[0].click()", ok) + self.wait_for(lambda: self.browser.find_element( + By.CSS_SELECTOR, ".sea-deck-stack--levity" + ).is_displayed()) + # ── Button presence ───────────────────────────────────────────────── # def test_deal_btn_absent(self): - """DEAL btn replaced by deck stacks + LOCK HAND.""" + """DEAL btn replaced by the deck stacks + AUTO DRAW.""" self._load_sea_overlay() self.assertEqual(self.browser.find_elements(By.ID, "id_sea_deal"), []) - def test_lock_hand_btn_present_and_disabled(self): - """LOCK HAND btn is present but disabled before any cards are drawn.""" - self._load_sea_overlay() - lock_btn = self.wait_for( - lambda: self.browser.find_element(By.ID, "id_sea_lock_hand") - ) - self.assertFalse(lock_btn.is_enabled()) - def test_del_btn_present(self): """DEL btn is always present in the sea overlay.""" self._load_sea_overlay() @@ -277,8 +290,10 @@ class PickSeaDealTest(ChannelsFunctionalTest): )) def test_clicking_stack_shows_ok_btn(self): - """Clicking a deck stack reveals its OK btn.""" + """Clicking a deck stack reveals its OK btn (spread chosen first — the + stacks live on the cross page, hidden until OK).""" self._load_sea_overlay() + self._choose_spread() stack = self.wait_for(lambda: self.browser.find_element( By.CSS_SELECTOR, ".sea-deck-stack--levity" )) @@ -323,9 +338,13 @@ class PickSeaDealTest(ChannelsFunctionalTest): By.CSS_SELECTOR, ".sea-pos-cover .sea-card-slot--filled" )) - def test_lock_hand_enables_after_six_draws(self): - """LOCK HAND btn becomes enabled once all 6 positions are filled.""" + def test_six_draws_complete_and_lock_the_deck_stacks(self): + """Drawing all 6 cards auto-completes the hand (no discrete LOCK HAND): + the deck-stack FLIP btns get `.btn-disabled` the instant the 6th card + lands — the synchronous completion marker, fired before the 3s-delayed + felt cascade. (SEED MAP / DRAW SEA --out is IT-covered.)""" self._load_sea_overlay() + self._choose_spread() for _ in range(6): stack = self.wait_for(lambda: self.browser.find_element( @@ -337,10 +356,14 @@ class PickSeaDealTest(ChannelsFunctionalTest): )) self.browser.execute_script("arguments[0].click()", ok_btn) - lock_btn = self.wait_for( - lambda: self.browser.find_element(By.ID, "id_sea_lock_hand") - ) - self.assertTrue(lock_btn.is_enabled()) + # Assert on the class (not is_displayed) — it survives the element going + # display:none when the felt later cascades out. + self.wait_for(lambda: self.assertIn( + "btn-disabled", + self.browser.find_element( + By.CSS_SELECTOR, ".sea-deck-stack--levity .sea-stack-ok" + ).get_attribute("class"), + )) def test_del_clears_drawn_cards(self): """DEL btn clears all drawn cards and resets positions to empty."""