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(Rating): fix issue with state snapshots and therefore provide decent support for mobile phones #2945

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LisaKirchhofer
Copy link

Corresponding issue can be found here: #2917

The problem was the following: 2 functions operating on the same state were wrapped within 1 parent function -> one of them setting a state, the other one reading the state. The reading function was expecting to get the new value from the state, set by the previous function. As react operates on snapshots, the reading function retrieved the old value instead of the new one. I took the opportunity and tried to refactor those parts.

@vercel
Copy link

vercel bot commented Nov 25, 2022

Someone is attempting to deploy a commit to the rsuite Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Nov 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
rsuite-nextjs ✅ Ready (Inspect) Visit Preview Nov 26, 2022 at 7:43AM (UTC)
1 Ignored Deployment
Name Status Preview Updated
rsuite-v4 ⬜️ Ignored (Inspect) Nov 26, 2022 at 7:43AM (UTC)

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9eb8133:

Sandbox Source
rsuite-tp-ci Configuration

@codecov
Copy link

codecov bot commented Nov 26, 2022

Codecov Report

Base: 92.89% // Head: 92.87% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (9eb8133) compared to base (f7855ca).
Patch coverage: 81.81% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2945      +/-   ##
==========================================
- Coverage   92.89%   92.87%   -0.03%     
==========================================
  Files         557      557              
  Lines       19898    19908      +10     
  Branches     2707     2709       +2     
==========================================
+ Hits        18484    18489       +5     
- Misses        764      766       +2     
- Partials      650      653       +3     
Flag Coverage Δ
ChromeCi 92.83% <81.81%> (-0.03%) ⬇️
Firefox 92.10% <81.81%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Rate/Rate.tsx 85.52% <81.81%> (-5.39%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@LisaKirchhofer
Copy link
Author

@simonguo or @SevenOutman can you please have a look? :)

@simonguo
Copy link
Member

hi @LisaKirchhofer
You need to add tests for the fixed code. The test script can be run by the following command:

M=Rate npm run tdd

@LisaKirchhofer
Copy link
Author

Hi @simonguo!
I did not change or extend any of the functionality. All of it is already covered in the existing code - I implemented against them. So the question is, which kind of Test do you expect?
The bug I fixed was a react specific one, rather than a functional one.
Thanks in advance, Lisa

@simonguo
Copy link
Member

simonguo commented Dec 2, 2022

The issues in #2917 are currently not covered by our test scripts. If this PR solves #2917, I hope there will be a corresponding test case. In the test script, the click and keyboard can be simulated, and the github action will also automatically run the test script in Chrome and Firefox browsers.

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

2 participants