-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add Progress Component #121
Conversation
@eanplatter where are we at on this guy, look like it needs a push from your local? |
@levithomason this is up to date, I am not sure why it says those commits are 9 days old. It has the updated meta and tests. |
<Progress> | ||
<div className='new-child' /> | ||
</Progress> | ||
).scryClass('new-child'); |
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.
Testing that it picks up it's children.
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.
scry
methods return arrays but do not throw if there are 0 results. So, this test has no assertion it will always pass. You can change it to findClass
which will throw an error if it finds 0, or more than 1. Or, we've added this assertText
which does a simple assertion that text is present (text is still a child):
render(<Progress>child</Progress>)
.assertText('child');
|
||
// it('should create a div with the class of progress', () => { | ||
// render(<Progress />).firstClass('progress'); | ||
// }); |
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.
I was having some trouble understanding the React-utils. This test was failing because it found two progress
classes on <Progress />
. I'd be interested in pairing on it.
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.
Me too! I'm still getting adjusted to the test utils and am interested in a pair here.
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.
Hero me up folks, I'll clear this up for both of you.
total: this.props.total, | ||
value: this.props.value, | ||
}); | ||
} |
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.
Moved all props to the this.element.progress
method.
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.
Passing React children to a jQuery plugin are we ;)
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.
...and html classes.
Please 💣 that |
after removing DS_Store 🉑 |
); | ||
}; | ||
|
||
renderStandardBar = () => { |
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.
I've asked this before but I'm still a little fuzzy as to why we're not prefixing instance methods like this with _
(e.g. _renderStandardBar
) to denote they are not apart of the api fingerprint for this component. /cc @levithomason
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.
Per Methods section of our fork of the Airbnb styleguide:
Do not use underscore prefix for internal methods of a react component.
Keep in mind these are not classes that users instantiate and use their methods as with a traditional library. JSX handle the class instantiation and interaction is done by props
mostly.
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.
More in depth here: airbnb/javascript#490
🍃 |
No description provided.