Commit Graph
659 Commits
Author SHA1 Message Date
Johannes Klein 757e157cd7 Update ProjectRequirements.test.js 2026-07-01 15:54:02 +02:00
Johannes Klein c850beec5a Update icon snapshots 2026-07-01 15:51:34 +02:00
Johannes Klein 827e0a682d Check for selected projects showing expanded chooser UI 2026-07-01 15:08:33 +02:00
Johannes Klein 4d48489652 Check for initial checked state 2026-07-01 15:03:43 +02:00
Johannes Klein 6a5a4178b8 Add an initial PO to test zustand store 2026-07-01 14:58:07 +02:00
Johannes Klein eca776f975 Code style 2026-07-01 14:36:25 +02:00
Johannes Klein 1df7b9cbad Test for list items being rendered 2026-07-01 14:28:51 +02:00
Johannes Klein b3034f4a27 Test for stable footer and header 2026-07-01 14:27:55 +02:00
Johannes Klein 65495d3813 Create AddToProjects.test.js 2026-07-01 14:23:04 +02:00
sepeterson 56315a9c45 Merge branch 'main' into mob-1339-search-autocomplete 2026-06-30 13:00:46 -05:00
sepeterson 678d85d8cd MOB-1339: test import change 2026-06-30 12:28:13 -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
Abbey Campbell 2a90146ec2 Merge pull request #3771 from inaturalist/mob-1462-search-myobs-ui-2
Mob 1462 search myobs UI 2
2026-06-29 15:01:41 -07:00
Johannes Klein 228059e6a9 Merge pull request #3761 from inaturalist/mob-1501-tpod-b1-obsedit-projects-row
ObsEdit projects row
2026-06-27 16:28:56 +02: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 Klein 73c598411c Merge pull request #3767 from inaturalist/mob-1496-tpod-a3-joined-projects-sync-to-realm
Traditional projects: joined projects sync to realm
2026-06-26 15:49:43 +02:00
Abbey Campbell 018a16612b fix tests 2026-06-25 20:49:05 -07:00
Johannes Klein 2d7376236c Merge branch 'main' into mob-1501-tpod-b1-obsedit-projects-row 2026-06-25 23:19:25 +02:00
Johannes Klein 06927bd9a8 Update icon snapshots 2026-06-25 19:04:06 +02:00
sepeterson 9e1376bcea MOB-1339: tests 2026-06-25 11:46:17 -05:00
sepeterson 7a1760d2c1 MOB-1339: rename taxonInput -> subjectInput for correctness 2026-06-25 11:15:15 -05:00
sepeterson 5a23b2f8db MOB-1339: clear subject input on tap if there's a subject set 2026-06-25 11:10:33 -05:00
sepeterson cf54517a0b MOB-1339: respect scientific name preference 2026-06-25 10:28:48 -05:00
Johannes Klein 01813ef582 Update ProjectListContainer with new fields query key 2026-06-25 14:22:33 +02:00
sepeterson 090822cea9 MOB-1339: move buildQueryParams to a helpers directory 2026-06-24 14:28:18 -05:00
Abbey Campbell 9bba1a3db2 Merge pull request #3759 from inaturalist/mob-1462-search-myobs-ui
Mob 1462 search myobs UI
2026-06-24 12:14:52 -07:00
Abbey Campbell d3707f5478 create myobs search screen and give myobs its own stack navigator 2026-06-24 11:10:41 -07:00
sepeterson 2f0f8a50ed MOB-1327: add test for null case 2026-06-23 16:45:54 -05:00
Johannes Klein 252c740bd8 Add unit tests 2026-06-23 14:17:57 +02:00
sepeterson ea30e0bdfc Merge branch 'main' into mob-1327-tabs 2026-06-22 13:13:37 -05:00
sepeterson 284cbc26c7 MOB-1327: add some tests 2026-06-21 22:05:57 -05:00
sepeterson a0cc15ad4a MOB-967: tests 2026-06-18 09:48:04 -05:00
Johannes Klein 8a4dcb6795 Merge branch 'main' into mob-1302-3-button-navigation-bar-covering-ui-on-all-screens 2026-06-16 13:19:24 +02:00
Johannes Klein cb31595a84 Merge branch 'main' into mob-1302-3-button-navigation-bar-covering-ui-on-all-screens 2026-06-16 13:08:28 +02:00
Seth Peterson 4cdb7b9ffc Merge pull request #3715 from inaturalist/mob-1338-universal-search-base-screen-layout
MOB-1338: universal search base screen layout
2026-06-12 10:28:57 -05:00
sepeterson 64f05fa87d MOB-1338: test changes 2026-06-11 23:41:45 -05:00
Abbey Campbell 95d9fd48c3 removemost faved from exploreV2 sort options 2026-06-09 16:25:35 -07:00
sepeterson 1241994521 MOB-1338: UniversalSearch unit tests 2026-06-09 12:00:37 -05:00
sepeterson 43ec16302e MOB-1338: ContainedSquareButton test 2026-06-09 10:57:08 -05:00
Johannes Klein 76cd0fd7bb Remove ViewWrapper mock 2026-06-09 15:13:46 +02:00
Johannes Klein 82e919b3dc Update snapshot tests 2026-06-09 15:11:24 +02:00
Johannes Klein de05552286 Display proper error message if project is invite only (#3676)
* Move ProjectDetails to TS

* Remove flow type

* Type object properties

* Narrower type possible for helper function

* Type nav prop

* Type route params away from here

* Type route params away from here

* Type more project keys

* Type route params to Explore

* Type place generic for now

* Type function props

* Update displayProjectType.ts

* WIP: Add Alert to dummy codepath

* Move Alert to on button press, so before sheet is displayed

* Update string

* Update ProjectDetails.tsx

* Update ProjectDetailsContainer.tsx

* Remove flow type

* Type nav props

* Type ApiProject with fields we query for in ProjectDetails

Also check which ones are nullable according to API V2 docs

* Reorder fields

* Also request place_id field

This must be some kind of bug because the next query expects that we are asking for this value for the project.

* Apparently ProjectDetails sends an entire api result over navigation params

* Fix a TS error

* Same fix

* Replace second API call with data we can get from project call

* Fix a TS error

* Nullable properties according to API docs, do actually get back as null to us and not undefined

* Null passes through as prop

* I don't think those can be null

* Add other API query types

* Refactor to not pass id as function param

* Also query for membership_model

* Code style

* This seems nonsensical to me

Omit project_type and then put it back in

* Lift rule_preferences type to ApiProject

* Query for rule_preferences in Project details

* Minimal interface to use this function

* Reinstate previous interface

* Project now has a rule_preference field from container

* Be specific with what keys we prop down from container

* Route params are not optional because of a prior null check

* Update mock

* Add a TODO

* Add export
2026-06-02 11:06:38 +02:00
Abbey Campbell 4e3da7f06a remove dupes and update call sites, move enum 2026-05-27 23:52:00 -07: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 26ff426a3f Merge pull request #3647 from inaturalist/mob-1395-potential-disagreement-not-allowing-you-to-choose-first
PotentialDisagreementSheet not allowing you to choose first value
2026-05-26 19:56:39 +02:00
Johannes KleinandClaude Opus 4.6 ea5e4bb20b MOB-1328: location permissions for ExploreV2 (#3623)
* MOB-1328: add NEEDS_PERMISSION place mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* MOB-1328: wire up location permissions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* MOB-1328: omit low value tests

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2026-05-26 13:09:48 +02:00
Johannes Klein fab478db7a Add some radio button sheet unit tests 2026-05-21 17:28:07 +02:00
Johannes Klein 372326dbb0 Update radio values mock as to current prop structure 2026-05-21 17:14:49 +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
sepeterson b8e0adf384 Merge branch 'main' into mob-1328-observations-location-permission-states 2026-05-14 15:14:14 -05:00