Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('Should work with object ref on element vNode', () => {
// create matching DOM
container.innerHTML = '<div>Okay<span>foobar</span></div>';
let newRef = createRef();
hydrate(
<div>
Okay
<span>Foobar</span>
</div>,
container
);
expect(newRef.current).toBe(container.querySelector('span'));
expect(container.innerHTML).toBe('<div>Okay<span>Foobar</span></div>');
});
it('Should work with object ref on element vNode', () => {
// create matching DOM
container.innerHTML = '<div>Okay<span>foobar</span></div>';
let newRef = createRef();
hydrate(
<div>
Okay
<span>Foobar</span>
</div>,
container
);
expect(newRef.current).toBe(container.querySelector('span'));
expect(container.innerHTML).toBe('<div>Okay<span>Foobar</span></div>');
});
constructor(props) {
super(props);
this.audioRef = createRef();
}