Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests android #6084

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Fix tests android #6084

wants to merge 1 commit into from

Conversation

Latropos
Copy link
Contributor

@Latropos Latropos commented Jun 6, 2024

Summary

This PR was extracted from #6047, it contains adjustments in individual test files that make them work on Android.

Test plan

Tested on Paper, Android. Works after applying changes from #6047

github-merge-queue bot pushed a commit that referenced this pull request Jun 17, 2024
## Summary
Previously recording snapshots of component containing multiple views
were generating array of all the updates in random order.

The new API is as follows:
```
const component = getTestComponent('ComponentRed');
expect(updatesContainer.getUpdates(component)).toMatchSnapshots(Snapshots.component);
```
If you don't specify any component, but snapshot recorded more than one
an error is thrown. Same if you specify a component, but there is only
one recording.

Other changes in this PR include:
* Organise logic of matcher functions:
  * Move rawMatchers into separate file
  * Move snapshot matchers into separate file
* Clean up error log of snapshot mismatch and format as an array:
<img width="625" alt="Screenshot 2024-06-06 at 16 23 20"
src="https://github.com/software-mansion/react-native-reanimated/assets/56199675/c239e65c-d71a-44af-83cd-c3256da1d51f">

 
## Test plan
File `Animations.test.tsx` was renamed into
`TestsOfTestingFramework.test.tsx`, include some tests of snapshot
mismatch (and mismatch of callback functions)
Tested on Paper, on IOS and Android. Some of the fixes, created to make
tests work well on Android, were extracted into separate PR
#6084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant