Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: hydrateSearchClient to make sure it caches results #5913

Merged

Conversation

aymeric-giraudet
Copy link
Member

@aymeric-giraudet aymeric-giraudet commented Oct 30, 2023

Summary

FX-2647

I started making e2e tests with wdio-intercept-service but due to limitations with selenium, there's no way to intercept requests made when the page loads reliably, only requests resulting from user actions can be tested :/

We would have to use Cypress or Puppeteer to test it then.

So this just tests the implementation itself, which is still better than nothing 😅
Also changed Object.values to Object.keys for it to build properly.

@aymeric-giraudet aymeric-giraudet requested review from a team, dhayab and sarahdayan and removed request for a team October 30, 2023 11:05
@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 30, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7ca599a:

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration
example-react-instantsearch-default-theme Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-vue-instantsearch-default-theme Configuration

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

👍

@aymeric-giraudet aymeric-giraudet force-pushed the test/ris-hydrate-search-client branch from ae2781f to e8b21ec Compare October 30, 2023 15:41
@aymeric-giraudet aymeric-giraudet force-pushed the test/ris-hydrate-search-client branch 2 times, most recently from df7dc4b to 2b37730 Compare October 30, 2023 16:07
@aymeric-giraudet aymeric-giraudet force-pushed the test/ris-hydrate-search-client branch from 2b37730 to 7ca599a Compare October 30, 2023 16:18
@aymeric-giraudet aymeric-giraudet merged commit 3b238f7 into poc/ris-hydrate-search-client Oct 30, 2023
@aymeric-giraudet aymeric-giraudet deleted the test/ris-hydrate-search-client branch October 30, 2023 16:27
aymeric-giraudet added a commit that referenced this pull request Oct 31, 2023
* feat(react-instantsearch): hydrate search client

* move function call in instantsearch.js

* test: `hydrateSearchClient` to make sure it caches results (#5913)

* test: add tests for `hydrateSearchClient` function

* add test in InstantSearchSSRProvider

* update bundlesize

---------

Co-authored-by: Aymeric Giraudet <aymeric.giraudet@algolia.com>
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