import React, { createRef } from 'react'; import { create } from 'react-test-renderer'; import { shallowJSON } from '../../src'; import { TestWrapper } from './TestWrapper'; import { FancyDiv, FancyDivArrow, FancyDivNamed, TestRef } from './ForwardRef'; describe('FancyDiv', () => { it('matches snapshot', () => { expect( shallowJSON(create().toTree()) ).toMatchSnapshot(); }); it('matches snapshot as children', () => { expect( shallowJSON( create( ).toTree() ) ).toMatchSnapshot(); }); }); describe('FancyDivArrow', () => { it('matches snapshot', () => { expect( shallowJSON(create().toTree()) ).toMatchSnapshot(); }); it('matches snapshot as children', () => { expect( shallowJSON( create( ).toTree() ) ).toMatchSnapshot(); }); }); describe('FancyDivNamed', () => { it('matches snapshot', () => { expect( shallowJSON(create().toTree()) ).toMatchSnapshot(); }); it('matches snapshot as children', () => { expect( shallowJSON( create( ).toTree() ) ).toMatchSnapshot(); }); }); describe('TestRef', () => { it('matches snapshot', () => { expect(shallowJSON(create().toTree())).toMatchSnapshot(); }); it('matches snapshot as children', () => { expect( shallowJSON( create( ).toTree() ) ).toMatchSnapshot(); }); });