import * as React from 'react'; import { Tabs } from '../index'; import render from '../../utils/_tests/render'; describe('props', () => { it('should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with CSS props', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly with defaultSelectedId', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly for fitted tabs', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly for center align', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly for right align', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly for boxed tabs', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly for button tabs', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly for unstyled tabs', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('should render correctly for vertical tabs', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); }); describe('theming', () => { it('Tabs.styles.base should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool , { theme: { Tabs: { styles: { base: { backgroundColor: 'red' } } } } } ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.List.styles.base should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool , { theme: { Tabs: { List: { styles: { base: { backgroundColor: 'red' } } } } } } ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Tab.styles.base should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool , { theme: { Tabs: { Tab: { styles: { base: { backgroundColor: 'red' } } } } } } ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Tab.styles.selected should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool , { theme: { Tabs: { Tab: { styles: { selected: { backgroundColor: 'red' } } } } } } ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Tab.styles.focus should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool , { theme: { Tabs: { Tab: { styles: { focus: { backgroundColor: 'red' } } } } } } ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Tab.styles.hover should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool , { theme: { Tabs: { Tab: { styles: { hover: { backgroundColor: 'red' } } } } } } ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Panel.styles.base should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool , { theme: { Tabs: { Panel: { styles: { base: { backgroundColor: 'red' } } } } } } ); expect(container.firstChild).toMatchSnapshot(); }); }); describe('overrides', () => { it('Tabs.styles.base should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.List.styles.base should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Tab.styles.base should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Tab.styles.selected should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Tab.styles.focus should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Tab.styles.hover should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); it('Tabs.Panel.styles.base should render correctly', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool ); expect(container.firstChild).toMatchSnapshot(); }); }); describe('defaultProps', () => { it('should render correctly for className', () => { const { container } = render( Dogs Cats Parrots Dogs are awesome Cats are alright Parrots are cool , { theme: { Tabs: { defaultProps: { className: 'test', color: 'primary' }, List: { defaultProps: { variant: 'boxed' } } }, }, } ); expect(container.firstChild).toMatchSnapshot(); }); });