import React, { createRef } from 'react'; import { create } from 'react-test-renderer'; import { shallowJSON } from '../../src'; import { TestWrapper } from './TestWrapper'; describe('HostComponent', () => { it('matches self-closing snapshot', () => { expect(shallowJSON(create(
).toTree())).toMatchSnapshot(); }); it('matches self-closing snapshot with key', () => { expect(shallowJSON(create(
).toTree())).toMatchSnapshot(); }); it('matches self-closing snapshot with key as children', () => { expect( shallowJSON( create(
).toTree() ) ).toMatchSnapshot(); }); it('matches self-closing snapshot with ref', () => { expect( shallowJSON(create(
).toTree()) ).toMatchSnapshot(); }); it('matches self-closing snapshot with ref as children', () => { expect( shallowJSON( create(
).toTree() ) ).toMatchSnapshot(); }); it('matches self-closing snapshot with prop', () => { expect( shallowJSON(create(
).toTree()) ).toMatchSnapshot(); }); it('matches self-closing snapshot with props', () => { expect( shallowJSON(create(
).toTree()) ).toMatchSnapshot(); }); it('matches self-closing snapshot with click handler', () => { expect( shallowJSON(create(
).toTree() ) ).toMatchSnapshot(); }); it('matches snapshot with dynamic children', () => { expect( shallowJSON( create(
    {['a', 'b', 'c'].map((value) => (
  1. {value}
  2. ))}
).toTree() ) ).toMatchSnapshot(); }); it('matches snapshot with empty children', () => { expect( shallowJSON( create(
    {[].map((value) => (
  1. {value}
  2. ))}
).toTree() ) ).toMatchSnapshot(); }); it('matches snapshot with subsequent dynamic children', () => { expect( shallowJSON( create(
    {['a', 'b', 'c'].map((value) => (
  1. {value}
  2. ))} {['d', 'e', 'f'].map((value) => (
  3. {value}
  4. ))}
).toTree() ) ).toMatchSnapshot(); }); it('matches snapshot with empty subsequent dynamic children', () => { expect( shallowJSON( create(
    {[].map((value) => (
  1. {value}
  2. ))} {[].map((value) => (
  3. {value}
  4. ))}
).toTree() ) ).toMatchSnapshot(); }); });