import React from 'react'; import { create } from 'react-test-renderer'; import { shallowJSON } from '../../src'; import { TestWrapper } from './TestWrapper'; describe('TestWrapper', () => { it.each([1, 2])('matches snapshot at depth of %s', (depth) => { expect( shallowJSON( create(
Children
).toTree(), { depth } ) ).toMatchSnapshot(); }); describe.each([null, undefined, true, false, 0, 1, '', 'foo'])( 'primitive of %s', (primitive) => { it.each([1, 2])('matches snapshot at depth of %s', (depth) => { expect( shallowJSON(create({primitive}).toTree(), { depth, }) ).toMatchSnapshot(); }); it.each([1, 2])( 'matches snapshot adjacently at depth of %s', (depth) => { expect( shallowJSON( create(
{primitive} ).toTree(), { depth } ) ).toMatchSnapshot(); } ); } ); it.each([1, 2])( 'matches snapshot with an array of children at depth of %s', (depth) => { expect( shallowJSON( create( {[ 'TEXT_NODE',
, , ]} ).toTree(), { depth } ) ).toMatchSnapshot(); } ); it.each([1, 2])( 'matches snapshot with a adjacent array of children at depth of %s', (depth) => { expect( shallowJSON( create(
{[ 'TEXT_NODE',
, , ]} ).toTree(), { depth } ) ).toMatchSnapshot(); } ); });