new migrations in apps.epic app; new models, urls, views handle the founder of a New Game inviting a friend via email to a game gatekeeper; ea. may drop coin in any of up to 6 avail. slots; FTs & ITs passing

This commit is contained in:
Disco DeDisco
2026-03-13 18:37:19 -04:00
parent 6a42b91420
commit e0d1f51bf1
8 changed files with 159 additions and 8 deletions

View File

@@ -90,3 +90,47 @@ class GatekeeperTest(FunctionalTest):
lambda: self.browser.find_element(By.ID, "id_applet_my_games")
)
self.assertIn("Dragon's Den", my_games.text)
def test_second_gamer_drops_token_into_open_slot(self):
# 1. Founder creates room, fills slot 1
self.create_pre_authenticated_session("founder@test.io")
self.browser.get(self.live_server_url +"/gameboard/")
self.wait_for(
lambda: self.browser.find_element(By.ID, "id_new_game_name")
)
self.browser.find_element(By.ID, "id_new_game_name").send_keys("Dragon's Den")
self.browser.find_element(By.ID, "id_create_game_btn").click()
self.wait_for(
lambda: self.assertIn("/gate/", self.browser.current_url)
)
room_url = self.browser.current_url
self.browser.find_element(By.CSS_SELECTOR, ".drop-token-btn").click()
self.wait_for(
lambda: self.browser.find_element(By.CSS_SELECTOR, ".gate-slot.filled")
)
# 2. Founder invites friend via email (duplicate invite logic from My Notes applet)
invite_input = self.wait_for(
lambda: self.browser.find_element(By.ID, "id_invite_email")
)
invite_input.send_keys("friend@test.io")
self.browser.find_element(By.ID, "id_invite_btn").click()
# 3. Friend logs in, sees invitation in My Games
self.create_pre_authenticated_session("friend@test.io")
self.browser.get(self.live_server_url + "/gameboard/")
my_games = self.wait_for(
lambda: self.browser.find_element(By.ID, "id_applet_my_games")
)
self.assertIn("Dragon's Den", my_games.text)
# 3. Friend follows link to gatekeeper
self.browser.find_element(By.LINK_TEXT, "Dragon's Den").click()
# 4. Friend sees drop btn on open slot
drop_btn = self.wait_for(
lambda: self.browser.find_element(By.CSS_SELECTOR, ".drop-token-btn")
)
drop_btn.click()
# 5. Now two slots filled
self.wait_for(
lambda: self.assertEqual(
len(self.browser.find_elements(By.CSS_SELECTOR, ".gate-slot.filled")), 2
)
)