Skip to content

Add basic unit tests#23

Merged
kdkavanagh merged 9 commits intomasterfrom
testing
Mar 25, 2026
Merged

Add basic unit tests#23
kdkavanagh merged 9 commits intomasterfrom
testing

Conversation

@kdkavanagh
Copy link
Copy Markdown
Owner

No description provided.

Claude Code and others added 9 commits March 24, 2026 23:59
…umns

- test_browsing: app startup, cursor movement, jump top/bottom, page up/down, resize
- test_filtering: filter reduces rows, clear restores, search highlights, next/prev, escape closes
- test_bookmarks_columns: toggle bookmark, bookmarks panel, column selector, column visibility, initial columns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- test_resize: incremental shrink/expand, shrink-then-restore, cursor validity
- test_bookmarks_columns: bookmark navigation via panel selection, multi-bookmark
  navigation, panel close on escape
- test_expressions: compute new column, use in filter, chain as input for
  further expressions, expression box close
- Moved resize test out of test_browsing into dedicated test_resize file

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add assertions that computed columns appear in table._dt.columns and
  table._widths after expression evaluation
- Remove unused imports and variables flagged by ruff

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 8 snapshot tests covering initial view, cursor movement, filtering,
search results, column selector, column hiding, narrow terminal, and
row detail. Fix mypy type errors in expression_box.py (None guard for
event.item.name) and browser.py (use empty string instead of None for
pending_action reactive). Add pytest-textual-snapshot dev dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Snapshot tests depend on environment-specific SVG rendering and fail in
CI. Mark them with a `snapshot` pytest marker and exclude from `make test`.
Add separate `make test-snapshot` target for local use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When snapshot tests fail in CI, the snapshot_report.html (visual diff)
is uploaded as a downloadable artifact and a note is added to the
workflow summary. Uses continue-on-error to ensure artifacts are
captured before failing the job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The snapshot baselines are generated locally and compared in CI.
Pin syrupy to 4.x to ensure both environments use the same snapshot
storage format and path conventions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FilterBox now reads DT_BROWSER_HISTORY_FILE to override the default
history path. A new autouse conftest fixture sets this to a temp file
per test, preventing history from leaking across tests when execution
order varies. Re-recorded snapshot for test_snap_filter_applied.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kdkavanagh kdkavanagh merged commit 71ed80c into master Mar 25, 2026
2 checks passed
@kdkavanagh kdkavanagh deleted the testing branch March 25, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant