import { create } from 'react-test-renderer'; import BannerSlim from './BannerSlim'; import Link from './Link'; import Text from './Text'; describe('BannerSlim', () => { it('renders neutral type with message', () => { const tree = create().toJSON(); expect(tree).toMatchSnapshot(); }); it('renders an icon with accessibility label', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders non-neutral compact with accessibility label', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders simple message with helper link', () => { const tree = create( {}, }} message="test" />, ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders complex message', () => { const tree = create( The campaign{' '} Back to School {' '} is regularly hitting its{' '} daily cap . Consider raising daily caps to increase scale for a similar CPC and CTR. } />, ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders primary action and dismiss button', () => { const tree = create( {}} primaryAction={{ accessibilityLabel: 'test', label: 'test', onClick: () => {}, role: 'button', }} />, ).toJSON(); expect(tree).toMatchSnapshot(); }); });