Menu

#402 test: move tray popover tests into ui/__tests__ (bun auto-discovers)

closed
nobody
None
2026-07-07
2026-07-07
Anonymous
No

Originally created by: Akarsh-Hegde

Summary

Run tray/src/__tests__/pause.test.js under CI + pre-push by moving it into ui/__tests__ (renamed popover-pause-utils.test.js), so the single existing bun test run auto-discovers it — no bespoke CI step or extra hook line.

Why (updated approach)

pause.test.js — 33 pure-logic tests for the popover's pause helpers (parsePauseMins / fmtCountdown / pauseLabel) — was never run: CI and the pre-push hook invoke bun test only with working-directory: ui, and bun only discovers tests under its cwd.

The first cut added an explicit bun test step in tray/src to both CI and the hook. Simpler, per review feedback: just move the test to ui/__tests__, where the popover's other test (popover-health-panel.test.ts) already lives. bun then picks it up in the one run, and the extra CI step + pre-push line are reverted.

Details

  • git mv tray/src/__tests__/pause.test.js → ui/__tests__/popover-pause-utils.test.js (94% unchanged); require path repointed to ../../tray/src/pause-utils.js.
  • Reverted the Tray popover tests step in ci.yml and the wave-2 tray line in .githooks/pre-push.
  • File stays plain .js (require-based, matching pause-utils.js's CommonJS export). ui/tsconfig.json include globs only **/*.ts(x), so npm run build doesn't typecheck it; bun test runs it fine.

Test plan

  • [x] cd ui && bun test268 pass (includes the 33 moved pause-utils tests).
  • [x] cd ui && npm run build clean (the .js test isn't in the tsc include set).
  • [x] ci.yml YAML valid; bash -n .githooks/pre-push clean.
  • [x] Pre-push hook exercised on push — ui tests covers the moved test, no separate tray step.

🤖 Generated with Claude Code

Related

Tickets: #416

Discussion

  • Anonymous

    Anonymous - 2026-07-07

    Originally posted by: coderabbitai[bot]

    [!IMPORTANT]

    Review skipped

    Auto reviews are disabled on base/target branches other than the default branch.

    Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.


    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro Plus

    Run ID: 3c46241e-f481-495b-9c48-97388a8eb956

    You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

    Use the checkbox below for a quick retry:
    - [ ] 🔍 Trigger review

    ✨ Finishing Touches
    🧪 Generate unit tests (beta) - [ ] Create PR with unit tests - [ ] Commit unit tests in branch `ci/tray-popover-tests`

    Comment @coderabbitai help to get the list of available commands.

     
  • Anonymous

    Anonymous - 2026-07-07

    Ticket changed by: Akarsh-Hegde

    • status: open --> closed
     

Log in to post a comment.