-
Notifications
You must be signed in to change notification settings - Fork 24
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
test(refs): added tests for ref utility #67
base: master
Are you sure you want to change the base?
Conversation
The specs are testing the internal utilities here. What about using the refs with actual components, dom elements and testing if we are getting expected values on ref are not. |
We probably can reuse the specs from React. You can also check for Preact specs. |
}); | ||
}); | ||
|
||
it('should set instance as current when setRef called with object type ref', () => { |
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.
setRef is inner API we should do integration test of it. Similar to what you did for forwardRefs.
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.
👍
expect(ref.current).toBe('instance'); | ||
}); | ||
|
||
it('should pass instance as param when setRef called with function type ref', () => { |
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.
^^
fix #45