Fix borderRadius-related bug in [ButtonGroup] #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
See Top-Right and Botton-Right radius. It is not working properly when data size is 1.
So I write tests, fix bug, and refactor code.
(remove
chained ternaries
as mentioned in Remove some chained ternaries #45)In the process of fixing bug, I made trivial changes.
CHILD_index
testID to make testing easier.Remove uselesstheme
prop / default valueRemovetestID
propI don't think user needtestID
prop. It is applied to Outermost View wrapper. But why user need to get that? They might write test code relate to each button. But they can to that withgetByText
orelement_index
testID. So it is no need to give them free to name it. Just name 'container' is fine for development use.Rename testID ([userInput - CHILD] -> [container - element])I thinkcontainer - element
gives better abstraction.Data prop shouldn't be optional. I remove default value and make it required.givens
library. I will explain reasons in discussion soon.Although it supports Typescript, I didn't define types because I think It's bit much for test code.
Related Issues
#45
Tests
I add tests to ensure [ButtonGroup] calculates proper
borderWidth
andborderRadius
.Checklist
yarn test
oryarn test -u
if you need to update snapshot.yarn lint