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

added tests; refactor some code. #12

Merged
merged 5 commits into from
Sep 28, 2017
Merged

added tests; refactor some code. #12

merged 5 commits into from
Sep 28, 2017

Conversation

corescan
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-32.8%) to 5.714% when pulling 0fbbe99 on develop into df3e80d on master.

1 similar comment
@coveralls
Copy link

coveralls commented Sep 21, 2017

Coverage Status

Coverage decreased (-32.8%) to 5.714% when pulling 0fbbe99 on develop into df3e80d on master.

@coveralls
Copy link

coveralls commented Sep 21, 2017

Coverage Status

Coverage decreased (-32.8%) to 5.714% when pulling efc1142 on develop into df3e80d on master.

Copy link
Member

@isuttell isuttell left a comment

Choose a reason for hiding this comment

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

Why did the coverage go down if we added more tests?

@@ -16,7 +16,8 @@ import SelectOption from './SelectOption';
import OutsideClick from 'ship-components-outsideclick';
import HighlightClick from 'ship-components-highlight-click';

import dispatch from './dispatch';
import dispatch from './lib/dispatch';
Copy link
Member

Choose a reason for hiding this comment

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

Hey, did you test this in any of the apps? I'm not sure the regex we use in webpack will babelify files in sub folders of the apps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not. I just tested the examples page which seems to be working.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verified to be working in OneSony against this webpack loader regex: /ship-components-.*\/src/

Should be ok to merge up now.

@@ -70,7 +71,7 @@ export default class Select extends React.Component {
*/
componentDidUpdate(prevProps, prevState) {
if (this.props.options.length > 5 && this.refs.selected && prevState.active === false && this.state.active === true) {
this.refs.selected.scrollIntoView();
scrollIntoView(ReactDOM.findDOMNode(this.refs.selected));
Copy link
Member

Choose a reason for hiding this comment

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

Do we need ReactDOM here?

Copy link
Contributor Author

@corescan corescan Sep 21, 2017

Choose a reason for hiding this comment

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

Yes, in this case "scrollIntoView" was a method of the SelectOption Component class. So in short, when I separated scrollIntoView into a lib folder it became a static function that requires a DOM node.

);

expect(() => TestUtils.renderIntoDocument(element))
.not.toThrow();
});

it('should support custom css classes', () => {
it('defines refs to input and list nodes', () => {
Copy link
Member

Choose a reason for hiding this comment

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

What does testing if the refs get set do? What's the functionality here you are testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Other tests that assert functionality should implicitly handle this case.

@corescan
Copy link
Contributor Author

No idea why coveralls rating decreased. I moved a couple functions into their own files under /lib and according to Jest's coverage report, I increased the coverage a good bit. Clearly everything bombed here with Travis, but locally everything passed.

@coveralls
Copy link

coveralls commented Sep 21, 2017

Coverage Status

Coverage decreased (-32.8%) to 5.714% when pulling 5e2b5eb on develop into df3e80d on master.

@coveralls
Copy link

coveralls commented Sep 21, 2017

Coverage Status

Coverage decreased (-32.8%) to 5.714% when pulling 7be7810 on develop into df3e80d on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+20.7%) to 59.259% when pulling 9268d64 on develop into df3e80d on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+20.7%) to 59.259% when pulling 9268d64 on develop into df3e80d on master.

@corescan corescan merged commit 54ce99a into master Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants