Menu ▾ ▴

#133 Extract and test the unread-bold and login-tidy logic; replace the tautological settings-button test

closed
nobody
2026-07-18
2026-07-17
Anonymous
No

Originally created by: kristofferR

  • The unread-bold heuristic (fontWeight >= 600 && text.trim().length > 1) is duplicated inline in notifications.ts and unread-badge.ts with zero coverage — a tweak to one silently diverges the badge from the notifier. Extract into lib/ with tests, along with the conversationFromLink leaf-text pipeline (aria-hidden/abbr filtering, deepest-leaf selection, title/body split) — the highest-churn pure logic in the tree.
  • login-tidy.ts's footer/language-strip classification is pure logic over link descriptors, was the site of a past regression, and has no tests; same for cookie-consent.ts's blue-score row selection.
  • lib/settings-button.test.ts asserts a hardcoded icon-path prefix matches itself — it cannot catch the thing that will actually break (Facebook shipping a new icon); protection has to come from selector-health instead.

Related

Tickets: #135
Tickets: #137

Discussion

  • Anonymous

    Anonymous - 2026-07-18

    Originally posted by: kristofferR

    Fixed in [#137]. The unread-bold and login-tidy logic was extracted into pure, unit-tested helpers under inject/src/messenger/lib/ with bun test coverage, replacing the tautological settings-button test.

     

    Related

    Tickets: #137

  • Anonymous

    Anonymous - 2026-07-18

    Ticket changed by: kristofferR

    • status: open --> closed
     

Log in to post a comment.