Sig select: caution tooltip, FLIP/FYI stat block, keyword display

- TarotCard.cautions JSONField + cautions_json property; migrations
  0027–0029 seed The Schizo (number=1) with 4 rival-interaction cautions
  (Roman-numeral card refs: I. The Pervert / II. The Occultist, etc.)
- Sig-select overlay: FLIP (stat-block toggle) + FYI (caution tooltip)
  buttons; nav PRV/NXT portaled outside tooltip at bottom corners (z-70);
  caution tooltip covers stat block (inset:0, z-60, Gaussian blur);
  tooltip click dismisses; FLIP/FYI fully dead while btn-disabled;
  nav wraps circularly (4/4 → 1/4, 1/4 → 4/4)
- SCSS: btn-disabled specificity fix (!important); btn-nav-left/right
  classes; sig-caution-* layout; stat-face keyword lists
- Jasmine suite expanded: stat block + FLIP (5 specs), caution tooltip
  (16 specs) including wrap-around and disabled-button behaviour
- IT tests: TarotCardCautionsTest (5), SigSelectRenderingTest (8)
- Role-card SVG icons added to static/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-04-07 00:22:04 -04:00
parent e2cc38686f
commit 520fdf7862
24 changed files with 1936 additions and 54 deletions

View File

@@ -269,16 +269,16 @@ class SigDeckCompositionTest(TestCase):
cards = sig_deck_cards(self.room)
self.assertEqual(len(cards), 36)
def test_sc_ac_contribute_court_cards_of_swords_and_cups(self):
def test_sc_ac_contribute_court_cards_of_blades_and_grails(self):
cards = sig_deck_cards(self.room)
sc_ac = [c for c in cards if c.suit in ("SWORDS", "CUPS")]
sc_ac = [c for c in cards if c.suit in ("BLADES", "GRAILS")]
# M/J/Q/K × 2 suits × 2 roles = 16
self.assertEqual(len(sc_ac), 16)
self.assertTrue(all(c.number in (11, 12, 13, 14) for c in sc_ac))
def test_pc_bc_contribute_court_cards_of_wands_and_crowns(self):
def test_pc_bc_contribute_court_cards_of_brands_and_crowns(self):
cards = sig_deck_cards(self.room)
pc_bc = [c for c in cards if c.suit in ("WANDS", "CROWNS")]
pc_bc = [c for c in cards if c.suit in ("BRANDS", "CROWNS")]
self.assertEqual(len(pc_bc), 16)
self.assertTrue(all(c.number in (11, 12, 13, 14) for c in pc_bc))
@@ -342,7 +342,7 @@ class SigCardFieldTest(TestCase):
defaults={"name": "Earthman Deck", "card_count": 108, "is_default": True},
)
self.card = TarotCard.objects.get(
deck_variant=earthman, arcana="MIDDLE", suit="WANDS", number=11,
deck_variant=earthman, arcana="MIDDLE", suit="BRANDS", number=11,
)
owner = User.objects.create(email="owner@test.io")
room = Room.objects.create(name="Field Test", owner=owner)
@@ -479,3 +479,54 @@ class SigCardHelperTest(TestCase):
self.owner.save()
self.assertEqual(levity_sig_cards(self.room), [])
self.assertEqual(gravity_sig_cards(self.room), [])
class TarotCardCautionsTest(TestCase):
"""TarotCard.cautions JSONField — field existence and Schizo seed data."""
def setUp(self):
self.earthman = DeckVariant.objects.get(slug="earthman")
def test_cautions_field_saves_and_retrieves_list(self):
card = TarotCard.objects.create(
deck_variant=self.earthman,
arcana="MINOR",
suit="CROWNS",
number=99,
name="Test Card",
slug="test-card-cautions",
cautions=["First caution.", "Second caution."],
)
card.refresh_from_db()
self.assertEqual(card.cautions, ["First caution.", "Second caution."])
def test_cautions_defaults_to_empty_list(self):
card = TarotCard.objects.create(
deck_variant=self.earthman,
arcana="MINOR",
suit="CROWNS",
number=98,
name="Default Cautions Card",
slug="default-cautions-card",
)
self.assertEqual(card.cautions, [])
def test_schizo_has_4_cautions(self):
schizo = TarotCard.objects.get(
deck_variant=self.earthman, arcana="MAJOR", number=1
)
self.assertEqual(len(schizo.cautions), 4)
def test_schizo_caution_references_the_pervert(self):
schizo = TarotCard.objects.get(
deck_variant=self.earthman, arcana="MAJOR", number=1
)
self.assertIn("The Pervert", schizo.cautions[0])
def test_schizo_cautions_use_reverse_language(self):
schizo = TarotCard.objects.get(
deck_variant=self.earthman, arcana="MAJOR", number=1
)
for caution in schizo.cautions:
self.assertIn("reverse", caution)
self.assertNotIn("transform", caution)