refactor(session): address review minors for issue #53

- SessionRowData.cell_data: list[Node | str] (date cells are str)
- strengthen test_session_row_fragment_via_htmx to assert OOB navbar

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 21:37:44 +02:00
parent ec6423cba5
commit 8637c547e4
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -255,13 +255,17 @@ class RenderedPagesTest(TestCase):
self.assertNoEscapedTags(html)
def test_session_row_fragment_via_htmx(self):
# The inline "finish session" endpoint returns a <tr> fragment.
# The inline "finish session" endpoint returns an in-place row swap
# (<tr id="session-row-{pk}">) plus an OOB navbar-playtime update.
resp = self.client.get(
reverse("games:list_sessions_end_session", args=[self.session.id]),
HTTP_HX_REQUEST="true",
)
html = resp.content.decode()
self.assertTrue(html.lstrip().startswith("<tr"))
self.assertIn(f'id="session-row-{self.session.id}"', html)
self.assertIn('id="navbar-playtime"', html)
self.assertIn('hx-swap-oob="true"', html)
self.assertIn(self.game.name, html)
self.assertNoEscapedTags(html)