@gechiui/block-editor
Version:
48 lines (42 loc) • 824 B
JavaScript
/**
* External dependencies
*/
import { shallow } from 'enzyme';
/**
* GeChiUI dependencies
*/
import { alignCenter, alignLeft, alignRight } from '@gechiui/icons';
/**
* Internal dependencies
*/
import BlockControls from '../';
import BlockEdit from '../../block-edit';
describe( 'BlockControls', () => {
const controls = [
{
icon: alignLeft,
title: '左对齐',
align: 'left',
},
{
icon: alignCenter,
title: '居中对齐',
align: 'center',
},
{
icon: alignRight,
title: '右对齐',
align: 'right',
},
];
it( 'should render a dynamic toolbar of controls', () => {
const wrapper = shallow(
<BlockEdit isSelected>
<BlockControls controls={ controls }>
<p>Child</p>
</BlockControls>
</BlockEdit>
);
expect( wrapper ).toMatchSnapshot();
} );
} );