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")
|
||||
|
||||
Reference in New Issue
Block a user