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: the Select and Option components #340

Merged
merged 4 commits into from
Aug 19, 2021
Merged

refactor: the Select and Option components #340

merged 4 commits into from
Aug 19, 2021

Conversation

wewoor
Copy link
Collaborator

@wewoor wewoor commented Aug 17, 2021

Description

Refactor the Select and Option components, and add unit tests for them.

Changes

  • Remove the useless property showArrow
  • Update the state of Select component via the getDerivedStateFromProps method when the value changed
  • Encapsulate the onClick event of Option, when set it is disabled, the onSelect event of Select component will not be triggered
  • Add the unit tests for both components

@wewoor wewoor changed the title test: the Select component WIP: test: the Select component Aug 17, 2021
@codecov
Copy link

codecov bot commented Aug 17, 2021

Codecov Report

Merging #340 (64582ab) into main (35958c9) will increase coverage by 4.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #340      +/-   ##
==========================================
+ Coverage   50.43%   54.49%   +4.05%     
==========================================
  Files         173      173              
  Lines        4596     4628      +32     
  Branches     1012     1020       +8     
==========================================
+ Hits         2318     2522     +204     
+ Misses       2250     2078     -172     
  Partials       28       28              
Impacted Files Coverage Δ
src/components/select/option.tsx 100.00% <100.00%> (+75.00%) ⬆️
src/components/select/select.tsx 100.00% <100.00%> (+87.69%) ⬆️
src/workbench/sidebar/explore/folderTree.tsx 10.84% <0.00%> (-0.55%) ⬇️
src/model/workbench/editor.ts 61.90% <0.00%> (-0.17%) ⬇️
src/common/dom.ts 66.10% <0.00%> (+3.38%) ⬆️
src/workbench/problems/paneView/index.tsx 40.00% <0.00%> (+16.00%) ⬆️
src/components/tabs/index.tsx 100.00% <0.00%> (+22.22%) ⬆️
src/components/tabs/tab.tsx 100.00% <0.00%> (+60.46%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35958c9...64582ab. Read the comment docs.

@wewoor wewoor mentioned this pull request Aug 18, 2021
53 tasks
@wewoor wewoor requested a review from mortalYoung August 18, 2021 09:16
@wewoor wewoor added the unit test The PR is for the unit test mainly label Aug 18, 2021
@wewoor wewoor self-assigned this Aug 18, 2021
@wewoor wewoor added this to the 0.9.0-alpha.5 milestone Aug 18, 2021
@wewoor wewoor changed the title WIP: test: the Select component refactor: the Select component Aug 18, 2021
@wewoor wewoor changed the title refactor: the Select component refactor: the Select and Option components Aug 18, 2021
@wewoor wewoor closed this Aug 19, 2021
@wewoor wewoor deleted the test/select branch August 19, 2021 03:24
@wewoor wewoor restored the test/select branch August 19, 2021 03:27
@wewoor wewoor reopened this Aug 19, 2021
Copy link
Collaborator

@mortalYoung mortalYoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@wewoor wewoor merged commit 15c393b into main Aug 19, 2021
@wewoor wewoor deleted the test/select branch August 19, 2021 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unit test The PR is for the unit test mainly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants