-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
Shouldn't ticket #382 precede this one? I mean, should we review that first or the order doesn't matter? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good to me, I tested around manually and everything seems to work well as expected. The stores get simplified step by step, and the same for the tests. Great job ⭐️
Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>
d8e5a05
to
2c60d09
Compare
Several changes added:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM so far. E2E tests pass locally. However when I manually tested it locally I'm unable to enter a new search term in the search results page. Well, I'm able to enter a new one, but when I submit it I keep getting the results from the original search.
Steps to reproduce:
- Go to
/
and enter a search term - Enter a new completely unrelated search term
- Observe that the results have not changed
The query string never updates either.
Oh no, I've checked and un-checked the filters and changed the search tabs so many times, but never tried to change the query, @sarayourfriend :) I've fixed the search term not updating, and also the "No image results for 'cat'" showing up in the MetaSearchForm while the page is still fetching. And removed a stray log. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! Everything works great and thank you so much for adding another e2e test for the failing case, I love to see that! Awesome work on this really great PR 🙂
Fixes
Fixes #383 by @zackkrida
Description
This is the first part of another big store refactoring. Instead of a
search
andfilter
store, there are amedia
and asearch
stores.Media store
This store is responsible for keeping information about the search results: the AudioResult or ImageResult arrays, the current Audio or Image, as well as the data about the fetching state (whether it is fetching or not, whether there is a fetching error).
Search store
This is where all the information about applied filters and search query is kept.
I've also added docstrings to actions, and found that they didn't have the necessary
await
s in them, which caused problems with loading (I still need to add several docstring descriptions).Next steps
The next step should be simplifying the query and filter handling:
The filters should be the source of truth for all query parameters except for
q
andmediaType
. This would also simplify media fetching for different media types.Testing Instructions
You can run the unit tests. Another thing I did was to create a new branch, merge the e2e tests from #394 into it, and test with
npm run test:e2e
. This has helped me see bugs that I didn't realize exist when testing manually. They all currently pass.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin