new apps.epic.tests.integrated.test_views.PickRolesViewTest.test_pick_roles_idempotent_no_duplicate seats passes w. duplicate no-op post ensures single line addition to apps.epic.views.pick_roles prevents ea. position from drawing twice ea. turn during Role Select phase at table; new assertions in FTs.test_room_role_select.RoleSelectChannelsTest.test_turn_passes_after_selection for same
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Disco DeDisco
2026-03-21 22:22:06 -04:00
parent f5c2cf4636
commit 184854a2de
3 changed files with 21 additions and 1 deletions

View File

@@ -501,6 +501,12 @@ class PickRolesViewTest(TestCase):
self.client.post(reverse("epic:pick_roles", kwargs={"room_id": self.room.id})) self.client.post(reverse("epic:pick_roles", kwargs={"room_id": self.room.id}))
mock_notify.assert_called_once_with(self.room.id) mock_notify.assert_called_once_with(self.room.id)
def test_pick_roles_idempotent_no_duplicate_seats(self):
url = reverse("epic:pick_roles", kwargs={"room_id": self.room.id})
self.client.post(url)
self.client.post(url) # second call must be a no-op
self.assertEqual(TableSeat.objects.filter(room=self.room).count(), 6)
class SelectRoleViewTest(TestCase): class SelectRoleViewTest(TestCase):
def setUp(self): def setUp(self):

View File

@@ -407,7 +407,7 @@ def select_role(request, room_id):
def pick_roles(request, room_id): def pick_roles(request, room_id):
if request.method == "POST": if request.method == "POST":
room = Room.objects.get(id=room_id) room = Room.objects.get(id=room_id)
if room.gate_status == Room.OPEN: if room.gate_status == Room.OPEN and room.table_status is None:
room.table_status = Room.ROLE_SELECT room.table_status = Room.ROLE_SELECT
room.save() room.save()
for slot in room.gate_slots.filter(status=GateSlot.FILLED).order_by("slot_number"): for slot in room.gate_slots.filter(status=GateSlot.FILLED).order_by("slot_number"):

View File

@@ -661,5 +661,19 @@ class RoleSelectChannelsTest(ChannelsFunctionalTest):
self.wait_for(lambda: self.browser2.find_element( self.wait_for(lambda: self.browser2.find_element(
By.CSS_SELECTOR, ".card-stack[data-state='eligible']" By.CSS_SELECTOR, ".card-stack[data-state='eligible']"
)) ))
# 5. Founder's stack is STILL ineligible — WS must not re-enable it
self.wait_for(lambda: self.assertEqual(
self.browser.find_element(
By.CSS_SELECTOR, ".card-stack"
).get_attribute("data-state"),
"ineligible",
))
# 6. Clicking founder's stack does not reopen the fan
self.browser.find_element(By.CSS_SELECTOR, ".card-stack").click()
self.wait_for(lambda: self.assertEqual(
len(self.browser.find_elements(By.ID, "id_role_select")), 0
))
finally: finally:
self.browser2.quit() self.browser2.quit()