import * as React from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { PageWithSidebar } from '../index';
import render from '../../utils/_tests/render';
describe('props', () => {
it('should render correctly', () => {
const { container } = render(this is a sidebar}>Hello world);
expect(container.firstChild).toMatchSnapshot();
});
it('should render correctly with sidebarPlacement', () => {
const { container } = render(
this is a sidebar} sidebarPlacement="right">
Hello world
);
expect(container.firstChild).toMatchSnapshot();
});
it('should render correctly with CSS props', () => {
const { container } = render(
this is a sidebar} color="primary">
Hello world
);
expect(container.firstChild).toMatchSnapshot();
});
});
describe('variants', () => {
it('styles.base should render correctly', () => {
const { container } = render(
this is a sidebar} variant="test">
hello world
,
{
theme: {
PageWithSidebar: {
variants: { test: { styles: { base: { backgroundColor: 'red' } } } },
},
},
}
);
expect(container.firstChild).toMatchSnapshot();
});
});
describe('overrides', () => {
it('styles.base should render correctly', () => {
const { container } = render(
this is a sidebar}
overrides={{
PageWithSidebar: { styles: { base: { backgroundColor: 'red' } } },
}}
>
hello world
);
expect(container.firstChild).toMatchSnapshot();
});
});
describe('theming', () => {
it('styles.base should render correctly', () => {
const { container } = render(
this is a sidebar}>hello world,
{
theme: {
PageWithSidebar: { styles: { base: { backgroundColor: 'red' } } },
},
}
);
expect(container.firstChild).toMatchSnapshot();
});
});
describe('defaultProps', () => {
it('should render correctly for className', () => {
const { container } = render(
this is a sidebar}>hello world,
{
theme: {
PageWithSidebar: { defaultProps: { className: 'test', color: 'primary' } },
},
}
);
expect(container.firstChild).toMatchSnapshot();
});
});