import { create } from 'react-test-renderer'; import Tag from './Tag'; describe('Tag', () => { it('renders', () => { const tree = create( {}} text="New" />, ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders a disabled tag', () => { const tree = create( {}} text="New" />).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders a tag with an error state', () => { const tree = create( {}} text="New" type="error" />).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders a tag with a warning state', () => { const tree = create( {}} text="New" type="warning" />).toJSON(); expect(tree).toMatchSnapshot(); }); it('clips long strings', () => { const tree = create( {}} text="The quick brown fox jumps over the lazy dog" />, ).toJSON(); expect(tree).toMatchSnapshot(); }); });