new _kit_bag_panel.html partial in core to allow user to manage equipped kit items from anywhere on site; #id_kit_btn moved from _footer.html partial directly into a base.html include; new trinket for superusers now incl. in apps.lyric.models; apps.gameboard.views handles this new type of PASS token; apps.epic.views allows payment with several different token types based on rarity & expiration hierarchy; kit bag and PASS functionality now handled in apps.dashboard.views; /kit-bag/ now pathed in .urls; styles abound; fully passing test suite (tho much work to be done, chiefly with stacking like coins in FEFO order)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Disco DeDisco
2026-03-15 01:17:09 -04:00
parent 4baaa63430
commit 2d453dbc78
16 changed files with 521 additions and 23 deletions

View File

@@ -0,0 +1,61 @@
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from .base import FunctionalTest
from apps.epic.models import Room
from apps.lyric.models import Token, User
class GameKitTest(FunctionalTest):
"""Game Kit <dialog>: opens from footer, shows token cards, dismisses."""
def setUp(self):
super().setUp()
self.create_pre_authenticated_session("gamer@kit.io")
self.gamer = User.objects.get(email="gamer@kit.io")
self.token = self.gamer.tokens.filter(token_type=Token.COIN).first()
self.room = Room.objects.create(name="Kit Room", owner=self.gamer)
self.gate_url = self.live_server_url + f"/gameboard/room/{self.room.id}/gate/"
def test_kit_btn_in_footer_opens_dialog(self):
self.browser.get(self.gate_url)
kit_btn = self.wait_for(
lambda: self.browser.find_element(By.ID, "id_kit_btn")
)
self.assertTrue(kit_btn.is_displayed())
kit_btn.click()
dialog = self.wait_for(
lambda: self.browser.find_element(By.ID, "id_kit_bag_dialog")
)
self.assertTrue(dialog.is_displayed())
def test_kit_dialog_shows_token_cards(self):
self.browser.get(self.gate_url)
self.browser.find_element(By.ID, "id_kit_btn").click()
self.wait_for(
lambda: self.browser.find_element(
By.CSS_SELECTOR,
f"#id_kit_bag_dialog [data-token-id='{self.token.id}']",
)
)
def test_kit_dialog_closes_on_escape(self):
self.browser.get(self.gate_url)
self.browser.find_element(By.ID, "id_kit_btn").click()
dialog = self.wait_for(
lambda: self.browser.find_element(By.ID, "id_kit_bag_dialog")
)
self.assertTrue(dialog.is_displayed())
dialog.send_keys(Keys.ESCAPE)
self.wait_for(
lambda: self.assertFalse(
self.browser.find_element(By.ID, "id_kit_bag_dialog").is_displayed()
)
)
def test_kit_btn_visible_outside_room(self):
self.browser.get(self.live_server_url + "/")
kit_btn = self.wait_for(
lambda: self.browser.find_element(By.ID, "id_kit_btn")
)
self.assertTrue(kit_btn.is_displayed())