Fix stale sidebar account-block test regex after markup change

test_sidebar_account_block_uses_leading_tight hardcoded flex flex-col
adjacency, but the account-block divs in app-sidebar.tsx now carry
min-w-0 (and flex-1) between flex and flex-col following the sidebar
truncation work (#7171). The leading-tight class is still present, so
this is a stale test rather than a UI regression. Loosen the regex to
allow the extra layout utilities while still asserting the leading-*
class the guard exists for.
This commit is contained in:
danielhanchen 2026-07-17 12:57:17 +00:00
commit 069aabb564

View file

@ -34,10 +34,11 @@ def test_model_selector_trigger_label_uses_leading_tight():
def test_sidebar_account_block_uses_leading_tight():
src = _read(APP_SIDEBAR)
# Match the account-block parent div regardless of its gap utility; this
# guard is about the leading-* class, not the spacing.
# Match the account-block parent div regardless of its other layout
# utilities (min-w-0 / flex-1 / gap-*); this guard is about the leading-*
# class, not the surrounding spacing/sizing classes.
pattern = re.compile(
r'<div\s+className="flex\s+flex-col\s+gap-\S+\s+(\S+)\s+group-data-\[collapsible=icon\]:hidden">',
r'<div\s+className="flex\b[^"]*\bflex-col\b[^"]*\s(\S+)\s+group-data-\[collapsible=icon\]:hidden">',
)
matches = pattern.findall(src)
assert matches, "could not find sidebar account-block parent div"