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

This commit is contained in:
Disco DeDisco
2026-03-15 16:57:24 -04:00
parent ff7b71792f
commit 12146037f0
6 changed files with 14 additions and 16 deletions

View File

@@ -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() {

View File

@@ -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")