kodefox / infra

KodeFox Product Infrastructure
MIT License
12 stars 11 forks source link

chore(exoflex): update `react`, `react-native` & `react-native-paper` version #713

Closed StefanusChristian closed 1 year ago

StefanusChristian commented 1 year ago

Changes:

Package & Example app changes:

Adjusted Component:

Contants, Helper & Types Changes:

How to test:

Notes:

Based on testing, the only component that has problem is ButtonRipple. The button didn't work properly on iOS simulator, but animation run properly on Android (cc: @JonathanRadotski @Udayawibawamukti).

ikusa commented 1 year ago

@StefanusChristian Also do we have the example of buttonRipple not working properly on the IOS? curious what's the actual result of these bug

darcien commented 1 year ago

Great work @StefanusChristian! We might need to update the repo settings before merging your changes because right now it's blocked by a dead circleci check.

StefanusChristian commented 1 year ago

@ikusa @darcien Here's the video showing the ButtonRipple problem on iOS. The button onPress is invoked but didn't show the ripple animation at all.

https://user-images.githubusercontent.com/25154563/215960201-a3325f69-360f-48aa-ab20-292986cc07c2.mp4

darcien commented 1 year ago

Let's not block the upgrade PR on the button ripple issue. I'm keen to ship this B I G P R ASAP and address the minor issues separately.

darcien commented 1 year ago

For the repo setting (remove/bypass the circleci check), do you have the authority for that @darcien? I think I don't have the permission, so I can't adjust the setting

I've removed the required CircleCI check for merging the PR. In the future, we will need to migrate the CI.

@StefanusChristian can you try running the tests locally and see if it passes? After that is checked, we should be good to go

StefanusChristian commented 1 year ago

For the repo setting (remove/bypass the circleci check), do you have the authority for that @darcien? I think I don't have the permission, so I can't adjust the setting

I've removed the required CircleCI check for merging the PR. In the future, we will need to migrate the CI.

@StefanusChristian can you try running the tests locally and see if it passes? After that is checked, we should be good to go

Screen Shot 2023-02-07 at 11 05 35 AM Screen Shot 2023-02-07 at 11 07 09 AM

It seems the jest preset is error for getBaseWebPreset, since the jest-preset is removed from the latest react-native-web (0.18.xx). Reference: https://github.com/necolas/react-native-web/issues/2312

Do you guys have any idea on how to fix the jest-preset? @ikusa @darcien

StefanusChristian commented 1 year ago

@ikusa @darcien Web jest & test finally adjusted πŸŽ‰πŸŽ‰πŸŽ‰

Passed Tests https://user-images.githubusercontent.com/25154563/218062491-74b07419-78bb-4591-a685-f1b0c7faae24.mp4

I'll list the changes for making the web test work in here:

  1. Adjust the getBaseWebPreset (web platform jest-preset) to use module mapper based on latest rnw docs and set testEnvironment to jsdom for web.
  2. Upgrade @testing-library/react & react-dom to match our current react version.
  3. Add testID on some component that will turn into data-testid when rendered on our web test. Reference.
  4. Adjust function from @testing-library/react: wait into waitFor and fireEvent.click usage. For fireEvent adjustment, somehow the fireEvent.click call doesn't trigger the mock function, so I use below form instead and it works. This might need more time to investigate but I think the adjustment is good for now
    
    From:

fireEvent.click(getByTestId('button'));

Into:

fireEvent( getByTestId('button'), new MouseEvent('click', { bubbles: true, cancelable: true, }), );