Skip to content

test(search): cover title edge cases in session title resolution - #453

Merged
rnambaale merged 1 commit into
feat/search-keyword-corefrom
fix/431-search-title-layering
Oct 17, 2026
Merged

rnambaale merged 1 commit into
feat/search-keyword-corefrom
fix/431-search-title-layering

Conversation

@lmcdonough

Copy link
Copy Markdown
Collaborator

Refs #431

What

Adds four mock-backed edge-case tests for resolve_session_titles. No production code changes.

Why

Issue #431 asks that the title query stay out of the domain layer and that the fallback title behave correctly. The layering fix is already on the base branch (0a67ca9e, PR #420). These tests pin the edge cases the existing tests skipped.

How

Adds to entity_api/src/search/session_title_mock_tests.rs:

  • A whitespace-only session title falls back to Coaching session — YYYY-MM-DD.
  • A title with surrounding spaces is returned trimmed.
  • A mixed batch (titled, untitled, and an unknown id) returns exactly the known ids.
  • Duplicate ids in the input collapse to one map entry.

Testing

  • cargo test -p entity_api --features mock session_title: 8 of 8 pass (4 existing, 4 new).
  • cargo test -p domain -p web --features "domain/mock,web/mock" search: domain 10 pass, web 15 pass.
  • cargo fmt --all -- --check and cargo clippy -p entity_api --all-targets --features mock -- -D warnings: clean.
  • Not run: integration tests that compare search responses before and after. That is still open under Move the search title-hydration query out of the domain layer #431.

Blast radius

Test-only. Stacked on #420, so this PR's diff is one commit on top of that branch. Merge after #420 or retarget to main once #420 lands.

Gotchas

  • Base is feat/search-keyword-core, not main.
  • Changes are limited to tests, so production behavior is unchanged.

Generated with Claude Code

Adds mock tests for resolve_session_titles covering a whitespace-only
session title (falls back to the date), a title with surrounding spaces
(returned trimmed), a mixed batch of titled, untitled and unknown ids in
one call, and duplicate ids in the input. Refs #431.

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@lmcdonough lmcdonough added the enhancement Improves existing functionality or feature label Oct 16, 2026
@lmcdonough lmcdonough self-assigned this Oct 16, 2026
@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only PR appears safe to merge.

Summary

Adds four mock-backed tests for resolve_session_titles. Production code is unchanged.

  • Whitespace-only session titles use the dated fallback.
  • Session titles with extra spaces are returned trimmed.
  • Mixed session lookups keep only known ids.
  • Repeated session ids produce one title entry.

Reviews (1) · Last reviewed commit: "test(search): cover title edge cases in ..." · Reviewed by Greptile

@rnambaale rnambaale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lmcdonough

@rnambaale
rnambaale merged commit 23739ab into feat/search-keyword-core Oct 17, 2026
1 check passed
@rnambaale
rnambaale deleted the fix/431-search-title-layering branch October 17, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improves existing functionality or feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants