2018-07-20 18:41:39 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2020-10-15 12:41:39 +00:00
|
|
|
import { render } from '@testing-library/react';
|
2021-07-14 20:38:57 +00:00
|
|
|
import { createElement } from '@wordpress/element';
|
2018-07-20 18:41:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { ActivityCardPlaceholder } from '../';
|
|
|
|
|
|
|
|
describe( 'ActivityCardPlaceholder', () => {
|
|
|
|
test( 'should render a default placeholder', () => {
|
2020-10-15 12:41:39 +00:00
|
|
|
const { container } = render( <ActivityCardPlaceholder /> );
|
|
|
|
expect( container ).toMatchSnapshot();
|
2018-07-20 18:41:39 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
test( 'should render a card placeholder with subtitle placeholder', () => {
|
2020-10-15 12:41:39 +00:00
|
|
|
const { container } = render( <ActivityCardPlaceholder hasSubtitle /> );
|
|
|
|
expect( container ).toMatchSnapshot();
|
2018-07-20 18:41:39 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
test( 'should render a card placeholder with date placeholder', () => {
|
2020-10-15 12:41:39 +00:00
|
|
|
const { container } = render( <ActivityCardPlaceholder hasDate /> );
|
|
|
|
expect( container ).toMatchSnapshot();
|
2018-07-20 18:41:39 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
test( 'should render a card placeholder with action placeholder', () => {
|
2020-10-15 12:41:39 +00:00
|
|
|
const { container } = render( <ActivityCardPlaceholder hasAction /> );
|
|
|
|
expect( container ).toMatchSnapshot();
|
2018-07-20 18:41:39 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
test( 'should render a card placeholder with all optional placeholder', () => {
|
2020-10-15 12:41:39 +00:00
|
|
|
const { container } = render(
|
2020-02-14 02:23:21 +00:00
|
|
|
<ActivityCardPlaceholder hasAction hasDate hasSubtitle />
|
|
|
|
);
|
2020-10-15 12:41:39 +00:00
|
|
|
expect( container ).toMatchSnapshot();
|
2018-07-20 18:41:39 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
test( 'should render a card placeholder with multiple lines of content', () => {
|
2020-10-15 12:41:39 +00:00
|
|
|
const { container } = render( <ActivityCardPlaceholder lines={ 3 } /> );
|
|
|
|
expect( container ).toMatchSnapshot();
|
2018-07-20 18:41:39 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
test( 'should render a card placeholder with no content', () => {
|
2020-10-15 12:41:39 +00:00
|
|
|
const { container } = render( <ActivityCardPlaceholder lines={ 0 } /> );
|
|
|
|
expect( container ).toMatchSnapshot();
|
2018-07-20 18:41:39 +00:00
|
|
|
} );
|
|
|
|
} );
|