Skip to content

Commit

Permalink
test(Transition): Add test case for default findDOMNode
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Apr 9, 2019
1 parent dffec89 commit c12a5f2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/Transition-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,28 @@ describe('Transition', () => {
})

describe('findDOMNode', () => {
it('uses ReactDOM.findDOMNode by default', done => {
const expectDiv = sinon.spy(node => expect(node.nodeName).toEqual('DIV'));
const handleExited = () => {
expect(expectDiv.called).toBe(true);

done();
}

const wrapper = mount(
<Transition
in
timeout={10}
onExiting={expectDiv}
onExited={handleExited}
>
{status => <div><span>{status}</span></div>}
</Transition>
);

wrapper.setProps({ in: false });
})

it('can receive a custom findDOMNode method', done => {
class StrictModeTransition extends React.Component {
constructor(props) {
Expand Down

0 comments on commit c12a5f2

Please sign in to comment.