* Fetch user from server, set locale in realm and change language with i18next
* Added some Spanish translations so I can see localization working
* config QueryClient with `cacheTime: Infinity` to deal with "Jest did not
exit" errors
Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
These rules are largely based on the AirBnB ones, which are not quite standard
for the React Native world, where Prettier seems to be more common, but I
think they add a lot of useful checks, and unlike Prettier we can customize
them. This also just makes it easier for people on the iNat team to work on
the mobile app.
Some specific changes:
* Added eslint-plugin-react-hooks to eslint rules
* Added eslint-plugin-simple-import-sort to eslint rules
* Bugfix: could not import photo from gallery
* Added support for react-native/no-inline-styles eslint rule
* useUser should not bother fetching a user for a blank userId
* Several updates to testing
* Restructured tests so they are in their own dir at the root
* Added an integration test that mocks the response from inaturalistjs
* Instead of mocking Realm, I mocked the Realm config so it writes to an
in-memory database for tests
* Added test data factories with factoria and faker
TODO
* Try mocking hooks to make a unit tests for the ObsList component; it should
be possible to write unit tests for components with hooks
* Data in the in-memory Realm db is probably sticking around between tests; we
need a way to trash the db after each test
* Tried to address logbox failure in Github Actions test run
* Tried bumping the timeout for tests for github actions
* Added skip duplicates and Slack notification to test action
* Added unit test for ObsList
* Seriously, how much time do you need to run a test...
* Added missing factory import
* Test fixes for context & providers
* DRY out ObsList.test.js a bit
* Made ObsList.test.js synchronous
In theory I suspect all component tests should be synchronous because if
you've mocked out all the hooks, there should be no reason to wait for
effects to complete.
Also removed subscriptionRef which didn't seem to be doing anything.