role select channels FTs: equip Earthman deck in setUp — fixes no-deck guard block
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 <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user