-
Notifications
You must be signed in to change notification settings - Fork 13
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(core-react): Add type #175
Conversation
Type.propTypes = { | ||
Tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
style: PropTypes.oneOf([ | ||
'h1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, how were these types determined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are all the type options defined in core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean! 🚢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice tests!
No docs? 😢
Know you already merged but couple Q's
test('it renders type with ray body class', () => { | ||
const wrapper = mount(<Type>{SAMPLE_TEXT}</Type>); | ||
|
||
expect(wrapper.find(Type).length).toBe(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should you check that it has the ray body class since you are specifying that in it renders type with ray body class
); | ||
|
||
expect(wrapper.html()).toBe( | ||
'<div class="custom-class ray-text--body" data-stuff="hello">All their equipment and instruments are alive.</div>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
} | ||
|
||
Type.propTypes = { | ||
Tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this just be PropTypes.node
?
Thanks! 🙌
Soon! |
https://deploy-preview-175--ray-docs.netlify.com/core-react/storybook/?path=/story/type--default