Skip to content

Fix search to match notes containing the term - #337

Open
the-dsw wants to merge 1 commit into
mate-academy:mainfrom
the-dsw:fix-search-substring-match
Open

the-dsw wants to merge 1 commit into
mate-academy:mainfrom
the-dsw:fix-search-substring-match

Conversation

@the-dsw

@the-dsw the-dsw commented Oct 29, 2026

Copy link
Copy Markdown

matches() compared note.text to the term with ===, so search only returned notes whose text was exactly the term. Use includes() so any note containing the term is returned, as the search command intends.

Fixes the two failing search tests; all 3 tests now pass.

matches() compared note.text to the term with ===, so search only
returned notes whose text was exactly the term. Use includes() so any
note containing the term is returned, as the search command intends.

Fixes the two failing search tests; all 3 tests now pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved. The bug fix is correctly implemented - the matches function in lib/store.js now uses .includes() to check if the search term is contained within note text, which satisfies the requirement that the search command should list every note that contains the search term (not just exact matches). All core functional requirements are met: add, list, search, and delete commands work as specified. All three tests pass, confirming the implementation is complete and correct.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example ↩

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.

2 participants