577 Commits

Author SHA1 Message Date
Ryan Stelly
b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00
sepeterson
ebaf672a20 Merge branch 'main' into mob-722-pt2 2025-12-18 10:35:53 -06:00
sepeterson
722edb2928 MOB-722: toBeVisible 2025-12-18 10:34:31 -06:00
sepeterson
8839c21c3a MOB-722: photo section test fixes 2025-12-18 10:20:26 -06:00
Seth Peterson
84d4e19329 Merge pull request #3295 from inaturalist/mob-722-pt1
MOB-722 Match screen unit tests part one
2025-12-18 09:22:21 -06:00
sepeterson
eb0191f2f5 MOB-722: toBeVisible 2025-12-17 13:24:28 -06:00
sepeterson
0558de720c MOB-722: unneeded beforeAll 2025-12-15 16:03:29 -06:00
sepeterson
92240bcb70 MOB-722: unclear wording 2025-12-15 15:41:08 -06:00
sepeterson
85163958ed MOB-722: unneeded mock 2025-12-15 15:38:36 -06:00
sepeterson
42c7beab45 MOB-722: unneeded beforeall 2025-12-15 15:33:44 -06:00
sepeterson
40a7f912dd MOB-722 use a test taxon where the common name does not contain the scientific name 2025-12-15 15:26:20 -06:00
sepeterson
4f54996951 MOB-722 saved match unit tests part 2 2025-12-12 15:44:55 -06:00
Johannes Klein
741f053716 Remove mock (#3287) 2025-12-12 21:02:54 +01:00
Abbey Campbell
2c6eb6622a Merge pull request #3271 from inaturalist/mob-963-change-slideover-menu-to-be-a-static-page
Mob 963 change slideover menu to be a static page
2025-12-12 10:27:37 -08:00
Corey Farwell
c36c94a5df Remove unneeded getImageDimensions helper function. (#3200)
* Remove unneeded `getImageDimensions` helper function.

The built-in React Native function has an `async` API that we can call directly.

* Legit test failure

* Import Image from React Native

* Prefer using styledComponents.Image.getSize

* Revert "Prefer using styledComponents.Image.getSize"

This reverts commit 103ca9b3ef.
2025-12-12 10:58:42 +01:00
sepeterson
282fcf9c21 MOB-722 match unit tests part one 2025-12-11 17:11:03 -06:00
Abbey Campbell
0c07017ac6 update testID 2025-12-11 14:17:39 -08:00
Abbey Campbell
caca94fb48 update more tests and snapshots 2025-12-09 18:46:40 -08:00
Abbey Campbell
b8375e0254 update tests and snapshots 2025-12-09 18:46:40 -08:00
sepeterson
7ea31b224e Merge branch 'mob-512-implement-saved-match-screen' of https://github.com/inaturalist/iNaturalistReactNative into mob-512-implement-saved-match-screen 2025-12-08 18:11:37 -06:00
sepeterson
0d42eab08a MOB-512 edit tests to rm unnecessary code, make consistent with greater test suite, and rm out of scope test 2025-12-08 18:10:32 -06:00
Johannes Klein
2a51f5ad9c Add a unit test for when taxon is undefined 2025-12-07 21:39:00 +01:00
sepeterson
dfcf12cc73 MOB-512 merge main 2025-12-04 21:31:43 -06:00
sepeterson
57d5996736 MOB-512 add component test to check for correct savedMatch or obsDetail component 2025-12-03 18:02:28 -06:00
Abbey Campbell
2ee99d6c7b fix tests 2025-12-02 13:29:00 -08:00
Abbey Campbell
5a212adf6e update snapshots 2025-12-01 14:29:50 -08:00
sepeterson
ab96a0be89 Merge branch 'main' into mob-512-implement-saved-match-screen 2025-11-25 08:11:28 -06:00
Abbey Campbell
6ed6c2b31b comment tooltip tests back in 2025-11-21 12:33:04 -08:00
sepeterson
19cb7064a6 MOB-512 minimal unit test fix and prop spreading allowed for tests 2025-11-21 10:12:59 -06:00
Abbey Campbell
8b33319935 rename test files 2025-11-20 18:05:38 -08:00
Abbey Campbell
a23597f001 add back tooltip tests 2025-11-17 18:48:31 -08:00
Abbey Campbell
578f1d5ce4 fix tooltip implementation 2025-11-17 12:48:22 -08:00
Yaron Budowski
9c2facc680 MOB-925 - new designs for add-obs button sheet 2025-11-14 14:19:05 -08:00
Ryan Stelly
e4d3bd796c switch spy to mock 2025-11-07 11:55:09 -06:00
Ryan Stelly
7086d00d42 MOB-1000 mock user to fix unit test flake 2025-11-06 12:56:39 -06:00
Johannes Klein
6b21c914bf Remove expectation towards a no longer accessible prop 2025-10-28 21:53:01 +01:00
Johannes Klein
b20a99adec Show offline profile picture in header (#3142)
* Rename file without changes

* Revert "Rename file without changes"

This reverts commit a3de5e100d.

* Rename file without changes

* Refactor InlineUserBase to TS

* Update component Props

* Import as type

* Check if the user displayed is the current user and if so

also display the user image while offline.

* Update src/components/SharedComponents/InlineUser/InlineUserBase.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update InlineUser.test.js

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-16 00:19:35 +02:00
Johannes Klein
6aa195ceaf Fix: Double border on user icon in Me tab (#3135)
* Use Image with nativewind styling instead of FasterImageView

* Update UserIcon.test.js.snap

* Update unit tests
2025-10-14 21:22:24 +02:00
Kirk van Gorkom
2e08467692 Prevent WebView iframe loads from updating source (#3107)
* Prevent WebView iframe loads from updating source

* Use request type directly from the library that provides this param

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-10-09 14:26:10 +02:00
Johannes Klein
9c90c2e45f Update react-native to 0.79 (#3051)
* Upgrade helper: package.json

* Upgrade helper: gems

* Upgrade helper: Android

* Update AppDelegate

* Fix error in compiling

* Update package-lock.json

* Update Podfile.lock

* Update package-lock.json

* Update Podfile.lock

* Remove no longer needed mock

* Comment out entire test and not only the expect call

* Most other unit tests use this render helper function that

wraps the component in the entire app.

* Mock react-native exports as esModule

* Update .flowconfig

* Update Gemfile

* Revert "Comment out entire test and not only the expect call"

This reverts commit 8785f81529.
2025-10-01 22:44:14 -05:00
Johannes Klein
3c04df39a3 Enable New Architecture (#3111)
* Update gradle.properties

* Update Podfile

* Update react-native-mmkv

* Update Podfile.lock

* Delete useObservationsUpdatesWhenFocused.test.js

* Update closeOnboarding.js

* Fix failing button tap in e2e tests

* Create react-native-sensitive-info+6.0.0-alpha.9.patch

* Update bottom-sheets

* Refactor e2e timeout to file-wide const

* Remove check that fails

* Check for entire list item instead of comments count

* Longer delay to wait for observation deletion to make UI disappear
2025-09-27 08:28:13 -06:00
Johannes Klein
a3aaa66ed5 Update react-native-share-menu to build with use_frameworks static (#3109)
* Update react-native-share-menu

* Update Podfile.lock

* Create react-native-share-menu+6.0.0.patch

This is required as long as we are not setting use_frameworks to static

* Breaking change: Android react-native-share-menu now also has same Share structure as iOS

* Remove Android specific test structure

Because Android and iOS now have the same return type from our fork of react-native-share-menu
2025-09-21 18:23:20 -06:00
Corey Farwell
a43446909c Remove the need to specify TypeScript file extensions in imports (#3094)
* Don't require TS extensions in imports

* Resolve all import extension errors

* Remove file extension from import paths used in mocks

* Remove .d of type definition file paths

* Remove .d of type definition file and import as type

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-09-07 23:41:42 +02:00
Johannes Klein
49091f8fc4 Enable React Compiler (#3082)
* Update package.json

* Update package-lock.json

* Enable plugin

* Update package.json

* Update package-lock.json

* Update .eslintrc.js

* Create a new object instead of mutating the existing one

* Update SoundRecorder.js

* Do not mutate prop directly

* Do not mutate store value directly

* Disable compiler for zoom hook

Because it uses reanimated logic, and previous work laid out we should specifically disregard a rule of react here, unsure what to do here for now.

* Move array for tracking results into component

* Disable compiler for StandardCamera

* Do not mutate store value directly

* Disable compiler for FullPageWebView

* Do not mutate route param

* Remove unnecessary check if state is true before setting it to false

* Fix: user might be undefined

* Update reanimated usage with new compiler compliant API

* Fix: taxon might be undefined

* Fix: taxon might be undefined

* Fix: common pitfall of trying to render text outside of Text component

* Update interface

* Add package override

* Update package-lock.json

* Refactor updating of user preferences into User model

* Remove no memo directive from zoom

* Update file imports

* Migrate safeRealmWrite to TS

* Update interface and import path

* Update interface

* Refactor useLocaalObservation hook to not mutate return value of a function that should not be mutated

* Update tests to new return structure

* Remove useSafeRoute hook

We get the same information from error contexts and surrounding documents, and this hook was violating the rules of react by conditionally calling another hook.

* Use optional chaining

* Update TaxonNamesSetting.test.js

* Fix: use optional chaining

* Extend on RNTLs renderHook instead of re-implementing

* Remove unnecessary mock

* Remove unnecessary mock

* Remove unecessary mock

* Remove trailing spaces
2025-09-01 17:06:51 +02:00
Johannes Klein
b4516b7b25 Update react native to v0.78.x (#3043)
* Update package.json

* Update package.json

* Updates for native files with upgrade-helpers

* Update .flowconfig

* Update package-lock.json

* Update Podfile.lock

* Add react-dom types

* Update package-lock.json

* Wrong install

* Use types-react-codemod

* Update TaxonSearch.tsx

* Remove react-native-accessibility-engine dependency

This is currently not maintained and not compatible with RN 0.78

* Comment out accessibility tests

* Disable broken snapshot test

* Move broken test

* Move broken test

* Move broken test

* Remove duplicate file

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken test

* Remove duplicate file

* Move broken tests
2025-08-09 13:47:46 +02:00
Johannes Klein
a618b6e870 Update react-native-testing-library to latest (#3044)
* Update package.json

* Update package-lock.json

* Update

* Update to v13

* Update package-lock.json

* Breaking change: remove extend-expect

* Latest version

* Update package-lock.json

* Breaking change: Removed Accessibility matcher

* Update Suggestions.test.js

* Update DisplayTaxonName.test.js

* Testing the same but differently phrased

* Not really needed to test this

And since not.toHaveTextContent stopped working I just remove it.

* Update useTaxonSearch.test.js

* Move broken tests into folders that are not run

* Only move single tests that are failing

* This does work after all

* Remove only single tests that are broken

* Only move failed tests

* Only move failed tests

* Only move failed tests

* Does not pass on CI only
2025-08-05 13:44:49 +02:00
Johannes Klein
f10188250c Some Flow to Typescript migrations, in simple components (#3034)
* Update Attribution.tsx

* Update FollowButton.tsx

* Update LoginSheet.tsx

* Update UnfollowSheet.tsx

* Update UnfollowSheet.tsx

* Update EstablishmentMeans.tsx

* Update TaxonDetailsTitle.tsx

* Update Taxonomy.tsx

* Update TaxonMapPreview.tsx

* Update FullScreenActivityIndicator.tsx

* Update ActivityIndicator.tsx

* Update SpeciesSeenCheckmark.tsx

* Update Mortal.tsx

* Update HideView.tsx

* Update ConfidenceInterval.tsx

* Update ViewWrapper.tsx

* Update ScrollViewWrapper.tsx

* Update SimpleObservationLocation.tsx

* Update Divider.tsx

* Update DateTimePicker.tsx

* Update MediaNavButtons.tsx

* Update MediaNavButtons.tsx

* Update MediaNavButtons.tsx

* Update DisplayTaxon.tsx

* Update InputField.tsx

* Update InputField.tsx

* Update ObservationLocation.tsx

* Update WarningText.tsx

* Update LoadingIndicator.tsx

* Update CrosshairCircle.tsx

* Update CoordinatesCopiedNotification.tsx

* Update PhotoSharing.tsx

* Update TaxonDetailsMediaViewerHeader.tsx

* Update EvidenceButton.tsx

* Update TextSheet.tsx

* Update Wikipedia.tsx

* Update About.tsx

* Update About.tsx

* Update imports

* Code style
2025-08-01 12:25:46 +02:00
Johannes Klein
f17a346f23 Repair ObsWheel tooltip (#3022)
* Refactor Tooltip into AddObsModal

* Update AddObsModal.tsx

* Remove unintentionally hardcoded condition

* Disallow close modal while tooltip is visible

While the tooltip is visible the modal should not be dismissed

* Reinstate logged-in triggers

* Disable tooltip for users that just signed up

Because of a bug in showing the "Account creation" pivot card the trigger here is not always set to true and so the correct behaviour of showing the tooltip is currently not possible.

* Remove buggy check for button press

* Re-position modal

* Make sure we have numbers of observations by the user

We need it to make a decision on wether to show the tooltip. If we don't have it don't show it.

* Show the modal when tooltip should be shown

With a timeout because we have a lot of overlapping modals here.

* Remove react-native-walkthrough-tooltip dependency

* Add triangle under bubble

* Update snapshot tests
2025-07-31 10:15:53 +02:00
Johannes Klein
9c0fcf1d60 Recovery from observations not uploading (#3015)
* Log app version on start

This is helpful for log files sent in from users, to see what version of he code they were actually running while errors happened.

* Add some types

* Import as types

* Remove unused param

* Update types

* Add string

* Update strings.ftl

* Add explanatory text to login screen if logging in again

* Add TODO

* Define new error class

* Throw a RecoverableError if trying to upload without token

* Do not make a new Error if caught. Instead re-throw the one caught.

This preserves the RecoverableError type if thrown.

* Update string

* Add to return info of function that handles errors

* Recover from an error that login again might fix

By sending the user to the login screen. In case of a multi-observation upload we stop the current queue because subsequent observations will also error out (and send one navigation event each).

* Update errorHandling.test.js

* Revert "Add TODO"

This reverts commit 57437f1ece.

* Add unit tests for recovery options
2025-07-18 07:58:42 +02:00
Johannes Klein
979127ba02 Assert that observationPhoto position is a number (#3008)
* Update import

* Import realm models as types

* Remove unused import

* Add function param types

* Add function param types

* Rename param for consistency

* Remove unused function param

* Type param

* Update type

* Add TODO

* Import function param type

* File rename without change

* Update imports

* Add some fct types

* Add fct param types

* Add function param types

* Update ObservationPhoto.ts

* Remove unused param

* Type fct param

* Add type

* Remove unused param

* Update comment

* Add fct param type as accessed by local context

* Add types from what is accessed in function

* Add types

* Remove unused types

* Add basic type, as is used in  local context

* Bring require statement back

* Import other function param types

* Add property types

* Fix wrong extends

* Assert inputs and outputs for mapping a local observation photo to server action

* Update unit tests for errors

* Rename file

* Update imports
2025-07-10 08:15:03 +02:00