import React from 'react';
import { create } from 'react-test-renderer';
import { shallowJSON } from '../../src';
import {
Context,
ContextConsumer,
ContextProvider,
NamedContext,
NamedContextConsumer,
NamedContextProvider,
} from './Context';
import { TestWrapper } from './TestWrapper';
describe('Context', () => {
it('matches snapshot', () => {
expect(
shallowJSON(
create(
).toTree()
)
).toMatchSnapshot();
});
it('matches snapshot as children', () => {
expect(
shallowJSON(
create(
).toTree()
)
).toMatchSnapshot();
});
});
describe('ContextProvider', () => {
it('matches snapshot', () => {
expect(
shallowJSON(
create(
).toTree(),
{ depth: 2 }
)
).toMatchSnapshot();
});
it('matches snapshot as children', () => {
expect(
shallowJSON(
create(
).toTree()
)
).toMatchSnapshot();
});
});
describe('NamedContext', () => {
it('matches snapshot', () => {
expect(
shallowJSON(
create(
).toTree()
)
).toMatchSnapshot();
});
it('matches snapshot as children', () => {
expect(
shallowJSON(
create(
).toTree()
)
).toMatchSnapshot();
});
});
describe('NamedContextProvider', () => {
it('matches snapshot', () => {
expect(
shallowJSON(
create(
).toTree(),
{ depth: 2 }
)
).toMatchSnapshot();
});
it('matches snapshot as children', () => {
expect(
shallowJSON(
create(
).toTree()
)
).toMatchSnapshot();
});
});