import { create } from 'react-test-renderer';
import BannerCallout from './BannerCallout';
import Text from './Text';
describe('', () => {
test('Error BannerCallout', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
test('Warning BannerCallout', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
test('Info BannerCallout', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
test('message + title', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
test('message + title + primaryAction with href', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
test('message + title + primaryAction without href', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
test('message + title + primaryAction + secondaryAction', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
test('message + title + primaryAction + dismissButton', () => {
const tree = create(
{},
}}
iconAccessibilityLabel="info"
message="Insert a clever info bannercallout message here"
primaryAction={{
href: 'pinterest.com',
label: 'Visit Pinterest',
accessibilityLabel: '',
role: 'link',
}}
title="A Title"
type="info"
/>,
).toJSON();
expect(tree).toMatchSnapshot();
});
test('bannercallout with rich text message', () => {
const tree = create(
{},
}}
iconAccessibilityLabel="Info"
message={
You have invited{' '}
Leaf Media Agency
{' '}
to your business hierarchy. Once they accept, you will be able to manage their business
account.
}
primaryAction={{
accessibilityLabel: 'Resend invite',
label: 'Resend invite',
role: 'button',
}}
secondaryAction={{
accessibilityLabel: 'Cancel invite',
label: 'Cancel invite',
role: 'button',
}}
title="You've sent an invite"
type="info"
/>,
).toJSON();
expect(tree).toMatchSnapshot();
});
});