import { create } from 'react-test-renderer'; import Flex from './Flex'; import TagData from './TagData'; describe('TagData', () => { it('TagData has a tooltip', () => { const component = create( {}} selected text="Text Impressions" tooltip={{ text: 'This is a tooltip' }} />, ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); it('renders tagdata in RTL mode as expected', () => { const tree = create( {}} showCheckbox text="RTL Text Tag" /> , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders base color as expected', () => { const tree = create( {}} selected showCheckbox text="Text Impressions" tooltip={{ text: 'This is a tooltip' }} /> {}} selected showCheckbox text="Text Impressions" tooltip={{ text: 'This is a tooltip' }} /> , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders all colors as expected', () => { const colors = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']; const component = create( {colors.map((color: any) => ( {}} selected text="Text Impressions" tooltip={{ text: 'This is a tooltip' }} /> ))} , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); it('renders disabled selected state', () => { const component = create( {}} selected showCheckbox text="Text Impressions" tooltip={{ text: 'This is a tooltip' }} />, ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); it('renders disabled unselected state', () => { const component = create( {}} showCheckbox text="Text Impressions" tooltip={{ text: 'This is a tooltip' }} />, ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); it('renders dismissable button', () => { const component = create( {}} onTap={() => {}} selected showCheckbox text="Text Impressions" tooltip={{ text: 'This is a tooltip' }} />, ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); it('renders dismisible button with color background', () => { const component = create( {}} onTap={() => {}} selected showCheckbox text="Text Impressions" tooltip={{ text: 'This is a tooltip' }} />, ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); });