My Sea applet: split sign-gate vs empty-state ITs after Sprint 4b layered the gate ahead of the empty placeholder
- test_my_sea_applet_renders_empty_state_for_new_user was written before
Sprint 4b (cd0add1) added the applet-side sign-gate; a fresh user now
hits the gate branch in _applet-my-sea.html, never reaching .my-sea-empty.
- Renamed to test_my_sea_applet_renders_sign_gate_for_user_without_sig
+ added test_my_sea_applet_renders_empty_state_for_user_with_sig_no_draws
which sets user.significator (via personal_sig_cards) before re-fetching
/gameboard/. Both branches now pinned.
Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,13 +40,38 @@ class GameboardViewTest(TestCase):
|
|||||||
# flow lands in later sprints. Seeded via migration 0008.
|
# flow lands in later sprints. Seeded via migration 0008.
|
||||||
[_] = self.parsed.cssselect("#id_applet_my_sea")
|
[_] = self.parsed.cssselect("#id_applet_my_sea")
|
||||||
|
|
||||||
def test_my_sea_applet_renders_empty_state_for_new_user(self):
|
def test_my_sea_applet_renders_sign_gate_for_user_without_sig(self):
|
||||||
# A fresh user has no saved draws → the scroll container hosts a
|
# Sprint 4b — user with no significator sees the Look!-formatted
|
||||||
# single placeholder line ("No draws yet."), no card cells.
|
# gate (mirror of the standalone page), not the draw UX.
|
||||||
[empty] = self.parsed.cssselect("#id_applet_my_sea .my-sea-empty")
|
[_gate] = self.parsed.cssselect(
|
||||||
|
"#id_applet_my_sea .my-sea-sign-gate--applet"
|
||||||
|
)
|
||||||
|
# Draw-state nodes are suppressed while the gate is up.
|
||||||
|
self.assertEqual(
|
||||||
|
len(self.parsed.cssselect("#id_applet_my_sea .my-sea-empty")), 0,
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
len(self.parsed.cssselect("#id_applet_my_sea .my-sea-card")), 0,
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_my_sea_applet_renders_empty_state_for_user_with_sig_no_draws(self):
|
||||||
|
# Sig set + no saved draws → the scroll container hosts a single
|
||||||
|
# placeholder line ("No draws yet."), no card cells, no gate.
|
||||||
|
from apps.epic.models import personal_sig_cards
|
||||||
|
sig_pile = personal_sig_cards(self.user)
|
||||||
|
self.user.significator = sig_pile[0]
|
||||||
|
self.user.save()
|
||||||
|
response = self.client.get("/gameboard/")
|
||||||
|
parsed = lxml.html.fromstring(response.content)
|
||||||
|
[empty] = parsed.cssselect("#id_applet_my_sea .my-sea-empty")
|
||||||
self.assertIn("No draws yet", empty.text_content())
|
self.assertIn("No draws yet", empty.text_content())
|
||||||
cards = self.parsed.cssselect("#id_applet_my_sea .my-sea-card")
|
self.assertEqual(
|
||||||
self.assertEqual(len(cards), 0)
|
len(parsed.cssselect("#id_applet_my_sea .my-sea-card")), 0,
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
len(parsed.cssselect("#id_applet_my_sea .my-sea-sign-gate--applet")),
|
||||||
|
0,
|
||||||
|
)
|
||||||
|
|
||||||
def test_my_sea_applet_header_links_to_my_sea_page(self):
|
def test_my_sea_applet_header_links_to_my_sea_page(self):
|
||||||
[link] = self.parsed.cssselect("#id_applet_my_sea h2 a")
|
[link] = self.parsed.cssselect("#id_applet_my_sea h2 a")
|
||||||
|
|||||||
Reference in New Issue
Block a user