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

refactor: Refactor SelectList component to use React hooks #417

Merged

Conversation

kyoyadmoon
Copy link
Member

@kyoyadmoon kyoyadmoon commented Dec 14, 2023

Purpose

  • 重構有使用到 UNSAFE lifecycle 的 components,用 react hooks 改寫
  • 由於從 class component 改寫成 functional component,原本的 enzyme 測試針對 class component 的測試方法會失敗,因此也將對應的測試用 testing-library 重寫了
  • 這個 PR 只改寫了 SelectList,因為內容比較複雜、重寫的測試情境也滿多的,單獨發一個 PR

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Merging #417 (662b0f9) into project/upgrade-react-v18 (17aabd1) will increase coverage by 9.59%.
Report is 8 commits behind head on project/upgrade-react-v18.
The diff coverage is 98.64%.

Additional details and impacted files
@@                      Coverage Diff                      @@
##           project/upgrade-react-v18     #417      +/-   ##
=============================================================
+ Coverage                      88.24%   97.83%   +9.59%     
=============================================================
  Files                            151       69      -82     
  Lines                           1608     1434     -174     
  Branches                         283      279       -4     
=============================================================
- Hits                            1419     1403      -16     
+ Misses                           189       31     -158     
Files Coverage Δ
packages/form/src/SelectList.js 98.75% <98.64%> (-0.14%) ⬇️

... and 85 files with indirect coverage changes

@kyoyadmoon kyoyadmoon marked this pull request as ready for review December 15, 2023 04:46
packages/form/src/__tests__/SelectList.test.js Outdated Show resolved Hide resolved
Base automatically changed from refactor/remove-unsafe-lifecycles-part1 to project/upgrade-react-v18 December 19, 2023 05:26
Copy link

sonarcloud bot commented Dec 19, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@kyoyadmoon kyoyadmoon merged commit 1a7edf3 into project/upgrade-react-v18 Dec 19, 2023
5 checks passed
@kyoyadmoon kyoyadmoon deleted the refactor/remove-unsafe-lifecycles-part2 branch December 19, 2023 05:47
@zhusee2 zhusee2 added this to the v7 milestone Feb 2, 2024
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

4 participants