diff --git a/src/functional_tests/test_gatekeeper.py b/src/functional_tests/test_gatekeeper.py index da503e3..c3d8256 100644 --- a/src/functional_tests/test_gatekeeper.py +++ b/src/functional_tests/test_gatekeeper.py @@ -1,3 +1,5 @@ +import time + from selenium.webdriver.common.by import By from .base import FunctionalTest @@ -195,6 +197,23 @@ class GatekeeperTest(FunctionalTest): )) self.assertFalse(Room.objects.filter(name="Doomed Room").exists()) + def test_gatekeeper_overlay_persists_after_htmx_poll(self): + # 1. Create room directly (GATHERING) and navigate to its gate URL + self.create_pre_authenticated_session("founder@test.io") + founder = User.objects.get(email="founder@test.io") + room = Room.objects.create(name="Persistent Room", owner=founder) + self.browser.get(self.live_server_url + f"/gameboard/room/{room.id}/gate/") + # 2. Assert overlay visible on initial page load + self.wait_for( + lambda: self.browser.find_element(By.CSS_SELECTOR, ".gate-overlay") + ) + # 3. Wait for HTMX poll cycle to fire (poll interval is 3s) + time.sleep(4) + # 4. Assert overlay still present and visible after poll + overlays = self.browser.find_elements(By.CSS_SELECTOR, ".gate-overlay") + self.assertEqual(len(overlays), 1) + self.assertTrue(overlays[0].is_displayed()) + def test_gamer_can_abandon_room_via_gear_menu(self): founder = User.objects.create(email="founder@test.io") room = Room.objects.create(name="Dragon's Den", owner=founder) diff --git a/src/static_src/scss/_gameboard.scss b/src/static_src/scss/_gameboard.scss index 7414f5d..39caa7a 100644 --- a/src/static_src/scss/_gameboard.scss +++ b/src/static_src/scss/_gameboard.scss @@ -93,6 +93,15 @@ body.page-gameboard { } } +#id_applet_my_games { + + ul { + display: flex; + flex-direction: column; + + } +} + #id_tooltip_portal { position: fixed; z-index: 9999; diff --git a/src/templates/apps/gameboard/_partials/_applet-my-games.html b/src/templates/apps/gameboard/_partials/_applet-my-games.html index 3840616..ae4edc1 100644 --- a/src/templates/apps/gameboard/_partials/_applet-my-games.html +++ b/src/templates/apps/gameboard/_partials/_applet-my-games.html @@ -7,7 +7,7 @@ {% for room in my_games %}
  • {{ room.name }}
  • {% empty %} -
  • No games yet
  • +
  • No games yet
  • {% endfor %} \ No newline at end of file diff --git a/src/templates/apps/gameboard/_partials/_applet-new-game.html b/src/templates/apps/gameboard/_partials/_applet-new-game.html index 3710f93..698a6a8 100644 --- a/src/templates/apps/gameboard/_partials/_applet-new-game.html +++ b/src/templates/apps/gameboard/_partials/_applet-new-game.html @@ -6,6 +6,6 @@
    {% csrf_token %} - +
    \ No newline at end of file diff --git a/src/templates/apps/gameboard/_partials/_gatekeeper.html b/src/templates/apps/gameboard/_partials/_gatekeeper.html index 1d11da7..9bb2428 100644 --- a/src/templates/apps/gameboard/_partials/_gatekeeper.html +++ b/src/templates/apps/gameboard/_partials/_gatekeeper.html @@ -1,36 +1,45 @@ - {% endblock content %} \ No newline at end of file