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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user