my-scrolls / my-games applet rows: prepend actor display_name to the body cell — the latest event's to_prose returns the action alone ("deposits a Carte Blanche…") because scroll.html splits the row across <strong>{{ event.actor|display_name }}</strong> + adjacent {{ to_prose|safe }}; the applet rows have a single middle column (<title> | <body> | <ts>) so they need both halves concatenated into .row-body; ROOM_CREATED welcome events (actor=None) keep rendering prose alone since to_prose already reads "Welcome to <name>!" — the {% if item.latest_event.actor %} guard skips the prefix, mirroring the same actor-guarded <strong> we added to _partials/_scroll.html + _applet-most-recent-scroll.html on c03fb2b so welcome lines don't carry a bogus empty actor; 2 ITs added — BillboardViewTest.test_my_scrolls_applet_row_body_includes_actor_display_name + GameboardViewTest.test_my_games_row_body_includes_actor_display_name — scoped to <span class="row-body">...stuart...deposits...</span> (regex match on the .row-body cell content) so the assertion can't pass on actor renders outside the row (the Most Recent Scroll applet on /billboard/ renders the same actor too, separately — initial pass missed this and assertIn("acto", body) matched there instead, hiding the bug); BillboardViewTest also gains test_my_scrolls_applet_row_body_no_actor_prefix_for_welcome to lock in the no-empty-prefix contract for ROOM_CREATED welcome events; 931 ITs green; settings.local.json fix-up — Bash(git add *) (literal * would only match the exact string "git add *", not git add -u) → Bash(git add:*) + companion read-only git patterns (status / diff / log / show) so the in-session commit flow stops prompting — TDD

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-13 00:13:33 -04:00
parent 054b0aa82b
commit b2f1511c2d
4 changed files with 68 additions and 2 deletions

View File

@@ -230,6 +230,43 @@ class BillboardViewTest(TestCase):
# scroll row carries a <time> + some body content (event prose)
self.assertRegex(body, r'<time[^>]+class="[^"]*row-ts')
def test_my_scrolls_applet_row_body_includes_actor_display_name(self):
"""Latest event prose w.o. the actor name is meaningless — `deposits
a Carte Blanche` should read `<actor> deposits a Carte Blanche`.
scroll.html renders actor via a separate `<strong>` adjacent to
prose; the applet row has a single body cell so we concatenate.
Scoped to the `.row-body` span (vs. a loose substring match) so
we don't pass on the Most Recent Scroll applet's actor render
— which renders the same actor too, separately."""
actor = User.objects.create(email="stuart@test.io", username="stuart")
room = Room.objects.create(name="ScrollRoom", owner=self.user)
record(
room, GameEvent.SLOT_FILLED, actor=actor,
slot_number=1, token_type="coin",
token_display="Coin-on-a-String", renewal_days=7,
)
response = self.client.get("/billboard/")
body = response.content.decode()
# The `.row-body` cell inside the My Scrolls applet must carry
# both the actor handle AND the event prose, in that order.
self.assertRegex(
body,
r'<span class="row-body">[^<]*stuart[^<]*deposits a Coin-on-a-String',
)
def test_my_scrolls_applet_row_body_no_actor_prefix_for_welcome(self):
"""Welcome events (actor=None) must not render an empty `<strong></strong>`
prefix before the prose — same shape the scroll.html template adopted."""
room = Room.objects.create(name="GreenroomTwo", owner=self.user)
record(room, GameEvent.ROOM_CREATED)
response = self.client.get("/billboard/")
body = response.content.decode()
self.assertIn("Welcome to GreenroomTwo!", body)
# No empty <strong> before the welcome line
self.assertNotRegex(
body, r'<strong>\s*</strong>\s*Welcome to GreenroomTwo!'
)
class SaveScrollPositionViewTest(TestCase):
def setUp(self):