Commit Graph
304 Commits
Author SHA1 Message Date
Johannes Klein 0755a08d69 Merge pull request #3961 from inaturalist/mob-1530-align-id-suggestions-taxon-selection-with-search
Align id suggestions taxon selection with search
2026-08-24 23:34:53 +02:00
Seth Peterson 3333495f90 MOB-1121: fix tests 2026-08-23 21:32:17 -05:00
Seth Peterson edc79c59f9 merge main 2026-08-21 10:05:08 -05:00
Johannes Klein dccb78344f Update SuggestionsWithUnsyncedObs.test.js 2026-08-21 13:21:42 +02:00
Johannes Klein 5a3558dee7 Remove checkmark testID from commented out tests 2026-08-21 12:24:42 +02:00
Johannes Klein 72fb43de9a Nav to TaxonDetails with info button 2026-08-21 12:18:31 +02:00
Johannes Klein bd04e37c01 Primary action of TaxonResult longer navs to TaxonDetails, use info button for nav 2026-08-21 12:17:28 +02:00
Johannes Klein 53d7f8ca41 Move testID up 2026-08-21 11:19:32 +02:00
Abbey Campbell 58d3233a5a Merge pull request #3946 from inaturalist/mob-1678-turn-on-myobs-sort-search-and-map-view
Mob 1678 turn on myobs sort search and map view
2026-08-18 13:10:46 -07:00
Abbey Campbell 0f95d9e398 remove feature flag dependent test 2026-08-14 15:40:28 -07:00
Seth Peterson 85b7b745e7 MOB-1406: show in universal search UI 2026-08-14 16:46:44 -05:00
Johannes Klein 2682bc0830 Remove Android test path
Since updating react-native-share-menu to version 7 there are no more differences in the return structure of the shared data. So, on both platforms the app should behave the same.
2026-08-13 13:18:24 +02:00
Seth Peterson 259604757a Merge pull request #3913 from inaturalist/mob-1337-explore-entry-points-from-other-screens
MOB-1337: other explore entry points
2026-08-11 13:37:25 -05:00
Seth Peterson b48dadef73 MOB-1337: 'Explore V2' to 'ExploreV2' 2026-08-11 10:12:55 -05:00
sepeterson 1a6d47bdd4 MOB-1337: tests 2026-08-07 16:12:07 -05:00
Johannes Klein b3b29360b6 Add a test 2026-08-06 12:03:14 +02:00
sepeterson 8064181dcd MOB-1543: clean up verbose claude comments 2026-07-29 15:05:12 +02:00
sepeterson f748b53727 MOB-1543: guard against dropping observations when cancelling 2026-07-29 15:05:12 +02:00
sepeterson 3c65c731be MOB-1543: separate abort controllers per queued obs upload 2026-07-29 15:05:12 +02:00
Abbey Campbell b7faf31a58 Merge pull request #3872 from inaturalist/mob-1482-add-a-map-view-to-myobs
Mob 1482 add a map view to myobs
2026-07-24 13:01:53 -07:00
Abbey Campbell 4759150a95 add tests for map view access 2026-07-23 13:13:30 -07:00
sepeterson 5cf1104e7b MOB-1557: use in useCurrentUser 2026-07-17 09:46:50 -05:00
Abbey Campbell 03a444373f Merge pull request #3803 from inaturalist/mob-1292-filled-id-and-comment-icons-not-appearing-until-you-navigate
Mob 1292 filled id and comment icons not appearing until you navigate
2026-07-08 08:44:39 -07:00
Abbey Campbell edb5c7572d test refactor 2026-07-06 13:02:41 -07:00
sepeterson 9eb759a789 fix unit test 2026-07-06 11:27:48 -05:00
Abbey Campbell 5062231888 remove hook that sets observations to viewed on foreground 2026-07-02 16:54:37 -07:00
sepeterson fa372dc8c3 potential flakiness test 2026-06-30 16:57:12 -05:00
Ryan Stelly 277816b0e0 MOB-1458 use local observation ids (#3763)
* only return observations from useLocalObs

* remove unnecessary var

* export unsync'd filter

* remove obsoleted numUnuploadedObservations zustand state

* tests, typo

* fix tests

* add sync fields to keypaths & depp array

* consistent naming

* handle only ids downstream

* switch over to useIds

* restore ids return

* memoize realm mapping result

* extract realm hooks mocks into factory-available helper

* reapply to myobsresults

* reapply to myobsresults

* go back to wrapped ids for list parity

* fix test

* restrict mocked prop for more accurate MyObsSimple test

* comment cleanup

* fix fake timer flake w/ corrected setup

Claude:

1. withAnimatedTimeTravelEnabled({ skipFakeTimers: true }) does NOT call jest.useFakeTimers(), but still calls jest.setSystemTime(new Date(0)) in beforeEach — which requires fake timers.
2. Both SoundRecorder.test.js and PhotoDeletionExisting.test.js (and ObsEdit.test.js) call global.timeTravel(300) inside waitFor, which also requires fake timers.
3. Tests pass flakily when fake timers accidentally leak from another test file running in the same Jest worker. When they don't leak, timeTravel throws.
4. FadeInView is fully mocked to a plain View (instant) and Reanimated uses setUpTests(), so the 300ms timeTravel isn't actually advancing any real animation — it's just broken.

The fix: guard setSystemTime with the same check, and remove the timeTravel(300) calls from waitFor in tests that use skipFakeTimers: true.

* fix remaining time travel uses

* reset / restore timers to fix leaking fake timers
2026-06-30 11:48:47 -05:00
Ryan Stelly 54517f6877 dedicated hook for "unsynced" and "missing basics" observations (#3743)
* only return observations from useLocalObs

* remove unnecessary var

* export unsync'd filter

* remove obsoleted numUnuploadedObservations zustand state

* tests, typo

* fix tests

* add sync fields to keypaths & depp array

* consistent naming

* reapply to myobsresults
2026-06-26 09:56:22 -05:00
Johannes KleinandJohannes Klein b498ffd379 Fix broken integration tests (#3720)
* Move one broken test and switch back to toBeVisible

* Remove comments

* Move without changes

* Add helper function

* Call mock helper in beforeAll

* Add fileName to mock assets

* Refactor navigateToPhotoImporter into helper

* Use fake timers and time travel

* File move without changes

* Add import

* Update addObsBottomSheet.js

* Refactor navigation steps into new helpers

* Add layout setup

* Use skipFakeTimers here

* Remove setup

* Replace final expectation

* Add mock for Mortal in a new helper file

* Sort imports

* Remove superfluous act

* Move file without changes

* Add time travel to final expect

* Use Mortal mock

* Change one test expect

TODO: is this still the same behaviour tested, toBeNull can be of other reasons as well?

* Refactor nav to Standard camera into new helpers

* Replace fireEvent with userEvent

* Update imports

* Move file without changesUpdate firebase mock

* Move file without changes

* Add Mortal mock

* Use toBeVisible again

* Use toBeVisible

* Refactor nav to AI camera into helpers

* Refactor take photo and na into helpers

* Refactor an action of the two previous combined actions

* Somehow there were two identical describe

* Wrong order

* No longer needed

* Refactor last expect of this test into helper

* Use global time travel here

* Remove import

* Move file without changes

* Use toBeVisible again

* Use Mortal mock

* Re-use already made helper fct here

* Fix imports

* Move file without changes

* Enable animated time travel

* Use toBeVisible

* Add time travel to last expects

* Remove double checks for being on the correct screen

* Move file without changes

* Add fileName to mock assets

* Switch back to toBeVisible

* Enable animated time travel

* Add time travel to last expect

* Re-use new navigation helper

* Add mock for InteractionManager

* Move file without changes

* Use toBeVisible again

* Add InteractionManager mock

* Add animate time travel

* Missing import

* Remove from previous commit

* Add helper shell

* Move the Save button press

* Move missing evidence sheet dismissal

* Update MyObservations.test.js

* Set screen after photo import

* Remove import

* Sort imports

* Add a mock for ImagePicker

* Navigate to PhotoImported instead of No evidence option

Does not matter for this test where the new obs comes from

* Re-use helper fct

* Arg name

* Disable lint

* Move file without changes

* Replace with new helper fct

* Enable animated time travel

* Replace also below with new helper

* Move fct call

* Use toBeVisible again

* Use toBeVisible again

* Use toBeVisible again with different find strategy

* Remove trip through Suggestions for this test

* Add InteractionManager mock

* Move beforeEach

* Move function call

* Re-use new helper function

* Handle saveOptions

* Missing imports

* Add helper function

* Wait for toolbar helper

* Wait for the element like we did before this PR

* Wait for one more element

* Update PhotoImport.test.js

* Comment out optional wait

* Rename arg

* File move without changes

* Re-use new helper function

* Re-use new helper function

* Use toBeVisible again

* Enable animated time travel

* Add a new find

* New helper fct

* Remove local version of confirm

* New take photo helper does more, so restrict to not confirm the photo yet here

* Update PhotoDeletion.test.js

* Update PhotoDeletion.test.js

* Remove fake timers

* Missing imports

* Add Mortal mock

* Update PhotoDeletion.test.js

* Update PhotoDeletion.test.js

* Copy PhotoDeletion test into new file to split out tests about existing photos

* Remove other todo test

* Add InteractionManager mock

* Remove Mortal mock

* Remove new photo test

* Delete new photo test

* Remove existing photo test

* Remove existing photo test

* Remove helper fct

* Remove import

* This should not have been deleted

* Refactor to use new helpers to create an obs with photo and wait on ObsEdit

* Add the part until we wait on ObsEdit

* Remove double await

* Rename describe

* This was wrongly inserted here

* Wait with time travel to be on camera

* At this point we have two photos, so tap on first one

* Update PhotoDeletionExisting.test.js

* Move beforeEach

* That was wrong, we should not have taken a second photo

* Remove cv mock

* Add import

* Add import

* Add import

* Remove location mock

* Update PhotoDeletionExisting.test.js

* Move file without changes

* Switch back to toBeVisible again

* Re-use new helper fct

* Add Mortal mock

* Move broken tests without changes

* Mock Mortal

* Use toBeVisible again

* Re-use new helper fct

* Enable animated time trael

* Camera needs different layout state

* This was pressing twice

* Remove tiny local helper

* Re-use local helper

* Remove unused code

* Remove ignore Paths

Yay

* Remove unused helper

* Update react-native-fs.ts

* Move fct out of try/catch

* Revert "Move fct out of try/catch"

This reverts commit f9a138e0dd.

* Only have find text in try catch

* Add mock for useObject

* Remove broken test

---------

Co-authored-by: Johannes Klein <17345891+jtklein@users.noreply.github.com>
2026-06-18 14:37:58 +02:00
Johannes Klein 7c6c537e34 Merge pull request #3683 from inaturalist/update-eslint-plugin-testing-library-to-7.16.2
Update eslint-plugin-testing-library to 7.16.2
2026-06-01 20:44:22 +02:00
Johannes Klein 43443f5cfc Consolidate ObsDetails screens (#3649)
* Create new hook shell

* Revert "Create new hook shell"

This reverts commit b6918db347.

* Copy ObsDetailsDefaultModeScreensWrapper as is to new file

* Copy ObsDetailsContainer as is into new file

* We don't need this param at this level

* Have new ObsDetailsContainer be the next child of screen

* Update props of new child and remove thereby hoisted code

* Move route param extraction into component that needs it

* Extract presentational logic into new component

* Also copy over flow types

* Also copy over flow types

* Return null if no observation

* Remove mode switch logic from navigator

* Remove no longer needed advanced mode container

* Consolidate default mode container into new one as well, and switch over default mode to show default mode UI

* Same as in advanced mode, read param where it is needed

* Remove prop

* Run the integration test on the only container

* Git mv test file and update with new import

* Move test and only keep the UI logic part being tested

* Move tests relevant for ObsDetailsScreen

* Update ObsDetailsScreen.test.js

* Update IdentificationSheets.test.js

* Remove unused screen wrapper
2026-05-27 16:27:27 +02:00
Johannes Klein 4ccf8e6cae Fallback UI for hidden content (#3628)
* Do not filter out hidden comments and IDs when getting an obs from server

* Do not add a filtered set of comments and IDs to local obs

Searching for visibleComments and visibleIdentifications anyways gives 0 results outside this file.

* Move file

* Remove flow

* Type fcts

* Add a type to item

* More types

* Add field to RealmTaxon

* Type navigation as used in ObsDetails

* Update ActivityItem.tsx

* Migrate FloatingButtons to TS

* Change prop type

* Rename ActivityHeader

* Migrate ActivityHeaderKebabMenu to TS

* Type functions

* Add undefined as possibility from TextInputSheet callback

* Revert "Add undefined as possibility from TextInputSheet callback"

This reverts commit 95b5fef2b9.

* Revert "Type functions"

This reverts commit 6997f195ce.

* Revert "Rename ActivityHeader"

This reverts commit e384c1f5a5.

* Revert "Update ActivityItem.tsx"

This reverts commit c1dc151b9a.

* Revert "Add field to RealmTaxon"

This reverts commit 965af041c0.

* Revert "More types"

This reverts commit 73af10bfcd.

* Revert "Add a type to item"

This reverts commit 5e5bf0ebae.

* Revert "Type fcts"

This reverts commit 84cac53e33.

* Revert "Type navigation as used in ObsDetails"

This reverts commit 9febf9ea30.

* Revert "Remove flow"

This reverts commit dca054c212.

* Revert "Move file"

This reverts commit bf62c0db95.

* Add UI for a hidden comment/ID

* Rename export like file name

* Update ID category text in tests

* Ask for hidden status from API and persist in realm

* Show fallback UI for hidden photos in PhotoContainer

* Update strings.ftl

* Show fallback UI for hidden sounds in SoundContainer

* Change mock to remoteObservation

Previously, this test file was relying on a faulty remoteObservation. The passed in remoteObservation was {} and because of the now removed filter code in useRemoteObservation what was passes into the test was {comments:[], identifications:[]} which made this test pass without ever using the useLocalObervation mock.

* Add eye icon to photo

* Add eye icon to sound

* Add eye icon to comments/IDs
2026-05-20 00:47:34 +02:00
Abbey Campbell 92d81d7be8 Mob 1239 obs sheet not dismissing (#3576)
* use bottom sheet api instead of returning null when hidden

* dedupe inside modal dismiss logic

* rename handleSnapPress -> openSheet

* ts fixes and split render into two branches

* fix integration test so we check for BottomSheet behavior rather than child absence

* snapshot updates + comments

* prevent hidden-state BottomSheet dismiss from triggering onPressClose

* port changes from BottomSheet to BottomSheetV2
2026-05-04 20:40:10 +02:00
Johannes Klein 3d9f2c3040 Refactor lodash function imports (#3348)
* Change destructured imports to individual imports

* Change full lodash imports to individual function imports

* Remove unused imports

* One more
2026-02-03 18:12:48 +01:00
sepeterson 0baef4ab75 MOB-721: consolidate test files 2026-01-09 09:11:38 -06:00
sepeterson 287cb5b94c MOB-721: fix tests, linting, and some visual bugs 2026-01-07 17:08:19 -06:00
sepeterson a8deb6f5f3 MOB-721: first pass component consolidation 2026-01-06 19:16:02 -06:00
Ryan Stelly 90db20c81e MOB-988 types supporting online/offline experiment flag (#3257)
* MOB-988 types supporting online/offline experiment flag

* typescript improvements to useSuggestions

* git test checkpoint

* revert functional changes and lessen change to type normalization

* undefify score params

* fix remaining type errors, tests

* reenable slack notif

* lint fixes from merge

* nullable common_ancestor
2025-12-26 21:00:29 -06:00
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 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
sepeterson dfcf12cc73 MOB-512 merge main 2025-12-04 21:31:43 -06:00
sepeterson 998f21a121 MOB-512 add map section tests 2025-12-04 21:23:13 -06:00
sepeterson 6c839f9036 MOB-512 rm silly import 2025-12-04 20:40:17 -06:00
sepeterson ff4537dd62 MOB-512 first pass SavedMatch integraton 2025-12-04 20:33:04 -06:00
Abbey Campbell 2ee99d6c7b fix tests 2025-12-02 13:29:00 -08:00
sepeterson ab96a0be89 Merge branch 'main' into mob-512-implement-saved-match-screen 2025-11-25 08:11:28 -06:00
sepeterson 19cb7064a6 MOB-512 minimal unit test fix and prop spreading allowed for tests 2025-11-21 10:12:59 -06:00
Yaron Budowski 9c2facc680 MOB-925 - new designs for add-obs button sheet 2025-11-14 14:19:05 -08: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