Sea Select FTs: drop the removed-LOCK-HAND tests + reveal the cross before stack interaction — TDD
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) <noreply@anthropic.com>
This commit is contained in:
@@ -209,7 +209,13 @@ def _make_sea_ready_room(earthman):
|
|||||||
|
|
||||||
@tag("channels")
|
@tag("channels")
|
||||||
class PickSeaDealTest(ChannelsFunctionalTest):
|
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):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
@@ -244,21 +250,28 @@ class PickSeaDealTest(ChannelsFunctionalTest):
|
|||||||
self.browser.execute_script("arguments[0].click()", btn)
|
self.browser.execute_script("arguments[0].click()", btn)
|
||||||
self.wait_for(lambda: self.browser.find_element(By.ID, "id_sea_overlay"))
|
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 ───────────────────────────────────────────────── #
|
# ── Button presence ───────────────────────────────────────────────── #
|
||||||
|
|
||||||
def test_deal_btn_absent(self):
|
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._load_sea_overlay()
|
||||||
self.assertEqual(self.browser.find_elements(By.ID, "id_sea_deal"), [])
|
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):
|
def test_del_btn_present(self):
|
||||||
"""DEL btn is always present in the sea overlay."""
|
"""DEL btn is always present in the sea overlay."""
|
||||||
self._load_sea_overlay()
|
self._load_sea_overlay()
|
||||||
@@ -277,8 +290,10 @@ class PickSeaDealTest(ChannelsFunctionalTest):
|
|||||||
))
|
))
|
||||||
|
|
||||||
def test_clicking_stack_shows_ok_btn(self):
|
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._load_sea_overlay()
|
||||||
|
self._choose_spread()
|
||||||
stack = self.wait_for(lambda: self.browser.find_element(
|
stack = self.wait_for(lambda: self.browser.find_element(
|
||||||
By.CSS_SELECTOR, ".sea-deck-stack--levity"
|
By.CSS_SELECTOR, ".sea-deck-stack--levity"
|
||||||
))
|
))
|
||||||
@@ -323,9 +338,13 @@ class PickSeaDealTest(ChannelsFunctionalTest):
|
|||||||
By.CSS_SELECTOR, ".sea-pos-cover .sea-card-slot--filled"
|
By.CSS_SELECTOR, ".sea-pos-cover .sea-card-slot--filled"
|
||||||
))
|
))
|
||||||
|
|
||||||
def test_lock_hand_enables_after_six_draws(self):
|
def test_six_draws_complete_and_lock_the_deck_stacks(self):
|
||||||
"""LOCK HAND btn becomes enabled once all 6 positions are filled."""
|
"""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._load_sea_overlay()
|
||||||
|
self._choose_spread()
|
||||||
|
|
||||||
for _ in range(6):
|
for _ in range(6):
|
||||||
stack = self.wait_for(lambda: self.browser.find_element(
|
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)
|
self.browser.execute_script("arguments[0].click()", ok_btn)
|
||||||
|
|
||||||
lock_btn = self.wait_for(
|
# Assert on the class (not is_displayed) — it survives the element going
|
||||||
lambda: self.browser.find_element(By.ID, "id_sea_lock_hand")
|
# display:none when the felt later cascades out.
|
||||||
)
|
self.wait_for(lambda: self.assertIn(
|
||||||
self.assertTrue(lock_btn.is_enabled())
|
"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):
|
def test_del_clears_drawn_cards(self):
|
||||||
"""DEL btn clears all drawn cards and resets positions to empty."""
|
"""DEL btn clears all drawn cards and resets positions to empty."""
|
||||||
|
|||||||
Reference in New Issue
Block a user