role-select.js ensures Role select card stack disappears via WS upon conclusion of Role selection, w. if-conditional support from apps.epic.views; ensured border present on card-stack when .active in _room.scss; changed default #id_tray to unhidden, only hidden during Role select until Role selected; polished & unified Role .card-front, .card.back & .card-stack styling

This commit is contained in:
Disco DeDisco
2026-04-05 01:14:31 -04:00
parent c00288e256
commit bd3d7fc7bd
7 changed files with 87 additions and 24 deletions

View File

@@ -846,4 +846,53 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest):
"Tray should be closed after turn advances"
))
# ------------------------------------------------------------------ #
# Test 7 — PICK SIGS appears + card stack removed on last role #
# ------------------------------------------------------------------ #
def test_pick_sigs_appears_and_card_stack_removed_on_last_role(self):
"""When the sixth and final role is confirmed, the all_roles_filled
WS event makes the PICK SIGS button visible and removes the card
stack from the DOM entirely."""
emails = [
"founder@test.io", "amigo@test.io", "bud@test.io",
"pal@test.io", "dude@test.io", "bro@test.io",
]
founder, _ = User.objects.get_or_create(email="founder@test.io")
room = Room.objects.create(name="Last Role Test", owner=founder)
_fill_room_via_orm(room, emails)
room.table_status = Room.ROLE_SELECT
room.save()
# Pre-assign 5 roles (slots 26); founder (slot 1) is the final picker.
pre_assigned = {2: "NC", 3: "EC", 4: "SC", 5: "AC", 6: "BC"}
for slot in room.gate_slots.order_by("slot_number"):
TableSeat.objects.create(
room=room,
gamer=slot.gamer,
slot_number=slot.slot_number,
role=pre_assigned.get(slot.slot_number),
)
room_url = f"{self.live_server_url}/gameboard/room/{room.id}/gate/"
self.create_pre_authenticated_session("founder@test.io")
self.browser.get(room_url)
self.wait_for(lambda: self.browser.find_element(
By.CSS_SELECTOR, ".card-stack[data-state='eligible']"
))
# Founder picks the last remaining role (PC — the only card in the fan).
self.browser.find_element(By.CSS_SELECTOR, ".card-stack").click()
self.wait_for(lambda: self.browser.find_element(By.ID, "id_role_select"))
self.browser.find_element(By.CSS_SELECTOR, "#id_role_select .card").click()
self.confirm_guard()
# PICK SIGS wrap must become visible via the all_roles_filled WS event.
self.wait_for(lambda: self.assertFalse(
self.browser.find_element(By.ID, "id_pick_sigs_wrap").get_attribute("style"),
))
# Card stack must be removed from the DOM entirely.
self.wait_for(lambda: self.assertEqual(
len(self.browser.find_elements(By.CSS_SELECTOR, ".card-stack")), 0,
))