Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
non-FragmentResource version of usePaginationFragment
Summary: Implements a new version of `usePaginationFragment()` backed by the new `useFragmentInternal()` and `useRefetchableFragmentInternal()`. The majority of the work here is reworking the unit test for this hook to test both environments. I ran into what I believe is a Jest bug related to `doMock()`, where for some reason the `unsubscribe` mock function identity was getting lost, and assertions about the number of unsubscribes were failing despite the function clearly being called the right number of times (confirmed with logging). I also got different results with `fit()` to isolate tests, where they would pass when focused but not when run with all tests. Given that these same tests worked before switching to describe.each, and i didn't change anything else substantial about the file (at that point), it makes me suspicious of a Jest bug. The use of the mock environment, and doMock generally, has always been a code smell though, so i refactored the test to use a normal environment instance and only mock the network layer. Reviewed By: davidmccabe Differential Revision: D37125130 fbshipit-source-id: 25e9b47d72f6d3631b6da7c5242df8017ad12e94
- Loading branch information