now that like token_types stack in UX, _0 removed from 4 test methods that previously looked for specific token's ID
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -3,13 +3,8 @@
|
||||
var dialog = document.getElementById('id_kit_bag_dialog');
|
||||
if (!btn || !dialog) return;
|
||||
|
||||
dialog.addEventListener('close', function () {
|
||||
btn.classList.remove('active');
|
||||
clearSelection();
|
||||
});
|
||||
|
||||
btn.addEventListener('click', function () {
|
||||
if (btn.classList.contains('active')) {
|
||||
if (dialog.hasAttribute('open')) {
|
||||
dialog.removeAttribute('open');
|
||||
btn.classList.remove('active');
|
||||
clearSelection();
|
||||
@@ -32,18 +27,22 @@
|
||||
|
||||
// Escape key
|
||||
document.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Escape' && dialog.open) {
|
||||
dialog.close();
|
||||
if (e.key === 'Escape' && dialog.hasAttribute('open')) {
|
||||
dialog.removeAttribute('open');
|
||||
btn.classList.remove('active');
|
||||
clearSelection();
|
||||
}
|
||||
});
|
||||
|
||||
// Click outside (but not on the rails button — let that flow through)
|
||||
document.addEventListener('click', function (e) {
|
||||
if (!dialog.open) return;
|
||||
if (!dialog.hasAttribute('open')) return;
|
||||
if (dialog.contains(e.target)) return;
|
||||
if (e.target === btn || btn.contains(e.target)) return;
|
||||
if (e.target.closest('button.token-rails')) return;
|
||||
dialog.close();
|
||||
dialog.removeAttribute('open');
|
||||
btn.classList.remove('active');
|
||||
clearSelection();
|
||||
});
|
||||
|
||||
// Inject token_id before token-rails form submits
|
||||
@@ -59,7 +58,7 @@
|
||||
hidden.name = 'token_id';
|
||||
hidden.value = window._kitTokenId;
|
||||
form.appendChild(hidden);
|
||||
if (dialog.open) dialog.close();
|
||||
if (dialog.hasAttribute('open')) dialog.removeAttribute('open');
|
||||
});
|
||||
|
||||
function attachCardListeners() {
|
||||
|
||||
@@ -32,7 +32,7 @@ class WalletViewTest(TestCase):
|
||||
[_] = self.parsed.cssselect("#id_coin_on_a_string")
|
||||
|
||||
def test_wallet_page_shows_free_token(self):
|
||||
[_] = self.parsed.cssselect("#id_free_token_0")
|
||||
[_] = self.parsed.cssselect("#id_free_token")
|
||||
|
||||
def test_wallet_page_shows_payment_methods_section(self):
|
||||
[_] = self.parsed.cssselect("#id_add_payment_method")
|
||||
|
||||
@@ -48,7 +48,7 @@ class GameboardViewTest(TestCase):
|
||||
[_] = self.parsed.cssselect("#id_game_kit #id_kit_coin_on_a_string")
|
||||
|
||||
def test_game_kit_has_free_token(self):
|
||||
[_] = self.parsed.cssselect("#id_game_kit #id_kit_free_token_0")
|
||||
[_] = self.parsed.cssselect("#id_game_kit #id_kit_free_token")
|
||||
|
||||
def test_game_kit_has_card_deck_placeholder(self):
|
||||
[_] = self.parsed.cssselect("#id_game_kit #id_kit_card_deck")
|
||||
|
||||
@@ -69,7 +69,7 @@ class GameboardNavigationTest(FunctionalTest):
|
||||
self.assertIn("Admit 1 Entry", coin_tooltip)
|
||||
self.assertIn("and another after that", coin_tooltip)
|
||||
# 7. Assert 1× Free Token (complimentary) present in kit
|
||||
free_token = self.browser.find_element(By.ID, "id_kit_free_token_0")
|
||||
free_token = self.browser.find_element(By.ID, "id_kit_free_token")
|
||||
# 8. Hover over it; assert tooltip shows name, entry text & expiry date
|
||||
ActionChains(self.browser).move_to_element(free_token).perform()
|
||||
self.wait_for(
|
||||
|
||||
@@ -62,7 +62,7 @@ class WalletDisplayTest(FunctionalTest):
|
||||
self.assertIn("Admit 1 Entry", coin_tooltip)
|
||||
self.assertIn("no expiry", coin_tooltip)
|
||||
# 10. Assert ×1 Free Token present (complimentary on signup)
|
||||
free_token = self.browser.find_element(By.ID, "id_free_token_0")
|
||||
free_token = self.browser.find_element(By.ID, "id_free_token")
|
||||
# 11. Hover over it; assert tooltip shows name, entry text, expiry date
|
||||
ActionChains(self.browser).move_to_element(free_token).perform()
|
||||
self.wait_for(
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
background-color: rgba(var(--priUser), 1);
|
||||
border: 0.15rem solid rgba(var(--secUser), 1);
|
||||
|
||||
&:hover,
|
||||
&.active {
|
||||
color: rgba(var(--quaUser), 1);
|
||||
border-color: rgba(var(--quaUser), 1);
|
||||
|
||||
Reference in New Issue
Block a user