-
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
Common test for events #223
Conversation
@@ -63,7 +63,7 @@ export default class Form extends Component { | |||
} | |||
|
|||
componentWillUnmount() { | |||
this.element.off() | |||
_.invoke(this, 'element.off') |
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 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()
.
04beb90
to
91e5c18
Compare
const leftPad = ' '.repeat(constructorName.length + listenerName.length + 3) | ||
|
||
handlerSpy.called.should.equal(true, | ||
`<${constructorName} ${listenerName}={${handlerName}} />\n` + |
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.
You can pass back a custom error message? What is this madness.
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.
Aye, most (all?) assertions allow this. Allows making crappy assertion errors good.
👻 |
91e5c18
to
b57619c
Compare
b57619c
to
d7d0a86
Compare
Blocked By
#222 (synthetic event)Adds common tests for event handling. Also fixes some minor issues with the common tests.