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

feat(Radio): Convert radio to TypeScript #1945

Merged
merged 2 commits into from
May 17, 2019
Merged

feat(Radio): Convert radio to TypeScript #1945

merged 2 commits into from
May 17, 2019

Conversation

rebeccaalpert
Copy link
Member

@rebeccaalpert rebeccaalpert commented May 7, 2019

Converted to TypeScript. I made a small change to the behavior since it was triggering a React warning related to switching from an uncontrolled to a controlled component (and back again) when you clicked the controlled radio and one about defaultChecked and checked being applied at the same time.

Fixes #1997.

@patternfly-build
Copy link
Contributor

PatternFly-React preview: https://1945-pr-patternfly-react-patternfly.surge.sh

@codecov-io
Copy link

codecov-io commented May 7, 2019

Codecov Report

Merging #1945 into master will increase coverage by 0.03%.
The diff coverage is 89.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1945      +/-   ##
==========================================
+ Coverage   82.33%   82.36%   +0.03%     
==========================================
  Files         628      628              
  Lines        6980     6998      +18     
  Branches      136      143       +7     
==========================================
+ Hits         5747     5764      +17     
+ Misses       1161     1160       -1     
- Partials       72       74       +2
Flag Coverage Δ
#patternfly3 84.88% <ø> (ø) ⬆️
#patternfly4 78.83% <89.65%> (+0.09%) ⬆️
#patternflymisc 95.68% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...ernfly-4/react-core/src/components/Radio/Radio.tsx 89.65% <89.65%> (ø)

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 236d1d5...5101bad. Read the comment docs.

@nicolethoen
Copy link
Contributor

@rebeccaalpert can you also add integration tests for this component as outlined on this README?

Copy link
Contributor

@dlabaj dlabaj left a comment

Choose a reason for hiding this comment

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

Should add integration tests for Radio and RadioProps.

@rebeccaalpert
Copy link
Member Author

Added demo/tests and addressed PR feedback.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

Looks great. couple of comments.

@@ -0,0 +1,26 @@
describe('Radio Demo Test', () => {
it('Navigate to demo section', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add some interactive test for checking and unchecking the controlled and uncontrolled buttons?

Copy link
Member Author

Choose a reason for hiding this comment

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

It has one for the controlled button, but the uncontrolled buttons don't change at all HTML-wise when they're selected, so I don't know that you can write that kind of test for them.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

@dlabaj dlabaj merged commit 11a77d4 into patternfly:master May 17, 2019
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.

Convert Radio to Typescript
7 participants