my_buds: dismiss "No buds yet" empty-state row async on first-bud add — _appendBudEntry queried .bud-entry--empty but _applet-list-shell renders it w. the family-agnostic .applet-list-entry--empty class; the selector never matched, so first-bud appends landed alongside the empty row instead of replacing it; existing test_add_bud_via_bud_btn_appends_entry extended to also assert the empty row dismisses post-add (caught the bug — TDD)

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-12 16:47:13 -04:00
parent be919c7aff
commit 17c4518944
2 changed files with 10 additions and 2 deletions

View File

@@ -55,6 +55,12 @@ class MyBudsPageTest(FunctionalTest):
self.wait_for(lambda: self.assertIn( self.wait_for(lambda: self.assertIn(
self.alice, list(self.gamer.buds.all()) self.alice, list(self.gamer.buds.all())
)) ))
# "No buds yet" empty-state row dismisses async as the first bud lands
# (shell partial renders w. .applet-list-entry--empty, not .bud-entry--empty)
self.wait_for(lambda: self.assertEqual(
self.browser.find_elements(By.CSS_SELECTOR, ".applet-list-entry--empty"),
[],
))
def test_no_autocomplete_suggestions_on_my_buds_page(self): def test_no_autocomplete_suggestions_on_my_buds_page(self):
"""The bud-autocomplete pool is request.user.buds — surfacing buds """The bud-autocomplete pool is request.user.buds — surfacing buds

View File

@@ -35,8 +35,10 @@
// Skip if already in DOM (server-side dedup ensures M2M idempotence; // Skip if already in DOM (server-side dedup ensures M2M idempotence;
// this guards a fast double-click that races the post-add refresh). // this guards a fast double-click that races the post-add refresh).
if (list.querySelector('[data-bud-id="' + bud.id + '"]')) return; if (list.querySelector('[data-bud-id="' + bud.id + '"]')) return;
// Drop the empty-state row if present // Drop the empty-state row if present — _applet-list-shell renders
var empty = list.querySelector('.bud-entry--empty'); // it w. `.applet-list-entry--empty` (NOT `.bud-entry--empty`); the
// shell sets the family-agnostic class.
var empty = list.querySelector('.applet-list-entry--empty');
if (empty) empty.remove(); if (empty) empty.remove();
var li = document.createElement('li'); var li = document.createElement('li');