Created
July 12, 2017 17:09
-
-
Save flarnie/46f744f6981f1f35861ef4cdeba67af1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let React = require('react'); | |
var ReactTestUtils = require('react-dom/test-utils'); | |
class TextWithStringRef extends React.Component { | |
render() { | |
return ( | |
<span ref="foo"> | |
Hello world! | |
</span> | |
); | |
} | |
} | |
describe('when loading two copies of React', () => { | |
describe('when different React version is used with string ref', () => { | |
it('has two different copies of React', () => { | |
jest.resetModules(); | |
let ReactCopy1 = require('react'); | |
expect(ReactCopy1 !== React).toBe(true); | |
}); | |
it('throws the "Refs must have owner" warning', () => { | |
jest.resetModules(); | |
let React = require('react'); | |
var testRefsComponent = ReactTestUtils.renderIntoDocument( | |
<TextWithStringRef />, | |
); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment