/**
* External dependencies
*/
import { Button } from '@wordpress/components';
import CustomizeIcon from 'gridicons/dist/customize';
import moment from 'moment';
import { Gravatar } from '@woocommerce/components';
import { render } from '@testing-library/react';
/**
* Internal dependencies
*/
import { ActivityCard } from '../';
describe( 'ActivityCard', () => {
test( 'should have correct title', () => {
const { getByRole } = render(
This card has some content
);
expect(
getByRole( 'heading', { name: 'Inbox message' } )
).toBeInTheDocument();
} );
test( 'should render a basic card', () => {
const { container } = render(
This card has some content
);
expect( container ).toMatchSnapshot();
} );
test( 'should render an unread bubble on a card', () => {
const { container } = render(
This card has some content
);
expect( container ).toMatchSnapshot();
} );
test( 'should render a custom icon on a card', () => {
const { container } = render(
}>
This card has some content
);
expect( container ).toMatchSnapshot();
} );
test( 'should render a gravatar on a card', () => {
const { container } = render(
}
>
This card has some content
);
expect( container ).toMatchSnapshot();
} );
test( 'should render a timestamp on a card', () => {
// We're generating this via moment to ensure it's always "3 days ago".
const threeDaysAgo = moment().subtract( 3, 'days' ).format();
const { container } = render(
This card has some content
);
expect( container ).toMatchSnapshot();
} );
test( 'supports a non-date "date" prop on a card', () => {
// We should be able to provide any string to the date prop.
const { container } = render(
This card has some content
);
expect( container ).toMatchSnapshot();
} );
test( 'should render an action on a card', () => {
const noop = () => {};
const { container } = render(
Action
}
>
This card has some content
);
expect( container ).toMatchSnapshot();
} );
test( 'should render multiple actions on a card', () => {
const noop = () => {};
const { container } = render(
Action 1
,
,
] }
>
This card has some content
);
expect( container ).toMatchSnapshot();
} );
} );