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 text', () => {
expect(
shallowJSON(create(lorem ipsum
).toTree())
).toMatchSnapshot();
});
it('matches snapshot with text and with prop', () => {
expect(
shallowJSON(create(lorem ipsum
).toTree())
).toMatchSnapshot();
});
it('matches snapshot with text and with props', () => {
expect(
shallowJSON(
create(
lorem ipsum
).toTree()
)
).toMatchSnapshot();
});
it('matches snapshot with children', () => {
expect(
shallowJSON(
create(
).toTree()
)
).toMatchSnapshot();
});
it('matches snapshot with dynamic children', () => {
expect(
shallowJSON(
create(
{['a', 'b', 'c'].map((value) => (
- {value}
))}
).toTree()
)
).toMatchSnapshot();
});
it('matches snapshot with empty children', () => {
expect(
shallowJSON(
create(
{[].map((value) => (
- {value}
))}
).toTree()
)
).toMatchSnapshot();
});
it('matches snapshot with subsequent dynamic children', () => {
expect(
shallowJSON(
create(
{['a', 'b', 'c'].map((value) => (
- {value}
))}
{['d', 'e', 'f'].map((value) => (
- {value}
))}
).toTree()
)
).toMatchSnapshot();
});
it('matches snapshot with empty subsequent dynamic children', () => {
expect(
shallowJSON(
create(
{[].map((value) => (
- {value}
))}
{[].map((value) => (
- {value}
))}
).toTree()
)
).toMatchSnapshot();
});
});