From 4b8e02b698277e9eb42bd643f1a4c8bf074ea79c Mon Sep 17 00:00:00 2001 From: Disco DeDisco Date: Tue, 28 Apr 2026 02:33:15 -0400 Subject: [PATCH] =?UTF-8?q?role=20select=20channels=20FTs:=20equip=20Earth?= =?UTF-8?q?man=20deck=20in=20setUp=20=E2=80=94=20fixes=20no-deck=20guard?= =?UTF-8?q?=20block?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The role-select.js no-deck guard (added with e512e94) shows a warning instead of opening #id_role_select when data-equipped-deck is empty. Three RoleSelectChannelsTest setups didn't equip a deck for the founder, so the card-stack click never opened the modal and all three failed with NoSuchElementException on #id_role_select. Only the founder needs equipping — other gamers' roles are ORM-assigned, no browser click. Code architected by Disco DeDisco Git commit message Co-Authored-By: Claude Sonnet 4.6 --- src/functional_tests/test_room_role_select.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/functional_tests/test_room_role_select.py b/src/functional_tests/test_room_role_select.py index b049d01..701c5ff 100644 --- a/src/functional_tests/test_room_role_select.py +++ b/src/functional_tests/test_room_role_select.py @@ -9,10 +9,18 @@ from selenium.webdriver.common.by import By from .base import FunctionalTest, ChannelsFunctionalTest from .management.commands.create_session import create_pre_authenticated_session from apps.applets.models import Applet -from apps.epic.models import Room, GateSlot, TableSeat +from apps.epic.models import DeckVariant, Room, GateSlot, TableSeat from apps.lyric.models import User +def _equip_earthman_deck(user): + """Equip the Earthman DeckVariant so the role-select no-deck guard passes.""" + deck = DeckVariant.objects.filter(name__icontains="Earthman").first() + if deck: + user.equipped_deck = deck + user.save(update_fields=["equipped_deck"]) + + def _fill_room_via_orm(room, emails): """Fill all 6 gate slots and set gate_status=OPEN. Returns list of gamers.""" gamers = [] @@ -713,6 +721,7 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest): def test_observer_sees_seat_arc_during_selection(self): founder, _ = User.objects.get_or_create(email="founder@test.io") + _equip_earthman_deck(founder) User.objects.get_or_create(email="watcher@test.io") room = Room.objects.create(name="Arc Test", owner=founder) _fill_room_via_orm(room, [ @@ -774,6 +783,7 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest): def _make_turn_test_room(self): founder, _ = User.objects.get_or_create(email="founder@test.io") + _equip_earthman_deck(founder) User.objects.get_or_create(email="friend@test.io") room = Room.objects.create(name="Turn Test", owner=founder) _fill_room_via_orm(room, [ @@ -859,6 +869,7 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest): "pal@test.io", "dude@test.io", "bro@test.io", ] founder, _ = User.objects.get_or_create(email="founder@test.io") + _equip_earthman_deck(founder) room = Room.objects.create(name="Last Role Test", owner=founder) _fill_room_via_orm(room, emails) room.table_status = Room.ROLE_SELECT