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

Common test for events #223

Merged
merged 2 commits into from
Apr 27, 2016
Merged

Common test for events #223

merged 2 commits into from
Apr 27, 2016

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Apr 26, 2016

Blocked By

#222 (synthetic event)


Adds common tests for event handling. Also fixes some minor issues with the common tests.

@@ -63,7 +63,7 @@ export default class Form extends Component {
}

componentWillUnmount() {
this.element.off()
_.invoke(this, 'element.off')
Copy link
Member Author

Choose a reason for hiding this comment

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

These don't actually matter since we moving away from jQuery, though, we simply calling this if it exists now. In tests, there is no off().

@levithomason levithomason force-pushed the feature/common-test-events branch 3 times, most recently from 04beb90 to 91e5c18 Compare April 26, 2016 22:33
const leftPad = ' '.repeat(constructorName.length + listenerName.length + 3)

handlerSpy.called.should.equal(true,
`<${constructorName} ${listenerName}={${handlerName}} />\n` +
Copy link
Member

Choose a reason for hiding this comment

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

You can pass back a custom error message? What is this madness.

Copy link
Member Author

Choose a reason for hiding this comment

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

Aye, most (all?) assertions allow this. Allows making crappy assertion errors good.

@dvdzkwsk
Copy link
Member

👻

@levithomason levithomason merged commit 73e8a53 into master Apr 27, 2016
@levithomason levithomason deleted the feature/common-test-events branch April 27, 2016 17:35
@levithomason levithomason mentioned this pull request May 24, 2016
24 tasks
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.

2 participants