Skip to content

fix: match notes by substring in search#2

Open
mgsell-lab wants to merge 1 commit into
mate-academy:mainfrom
mgsell-lab:fix/search-contains
Open

fix: match notes by substring in search#2
mgsell-lab wants to merge 1 commit into
mate-academy:mainfrom
mgsell-lab:fix/search-contains

Conversation

@mgsell-lab

Copy link
Copy Markdown

The matches function compared note text with strict equality, so search only returned notes whose text was exactly the term. Users expect search to find every note that contains the term.

Switch the comparison to String.includes, making search match on substrings as documented. This turns the two failing search tests green; all three tests now pass.

The `matches` function compared note text with strict equality, so
`search` only returned notes whose text was exactly the term. Users
expect search to find every note that contains the term.

Switch the comparison to `String.includes`, making `search` match on
substrings as documented. This turns the two failing `search` tests
green; all three tests now pass.
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