Add E2E tests for Featured Products (https://github.com/woocommerce/woocommerce-blocks/pull/4771)
This commit is contained in:
parent
da21021255
commit
37920b118d
|
@ -0,0 +1 @@
|
|||
{"title":"Featured Product Block","pageContent":"<!-- wp:woocommerce/featured-product /-->"}
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { getAllBlocks, switchUserToAdmin } from '@wordpress/e2e-test-utils';
|
||||
|
||||
import { visitBlockPage } from '@woocommerce/blocks-test-utils';
|
||||
|
||||
import { insertBlockDontWaitForInsertClose } from '../../utils.js';
|
||||
|
||||
const block = {
|
||||
name: 'Featured Product',
|
||||
slug: 'woocommerce/featured-product',
|
||||
class: '.wc-block-featured-product',
|
||||
};
|
||||
|
||||
describe( `${ block.name } Block`, () => {
|
||||
beforeAll( async () => {
|
||||
await switchUserToAdmin();
|
||||
await visitBlockPage( `${ block.name } Block` );
|
||||
} );
|
||||
|
||||
it( 'can be inserted more than once', async () => {
|
||||
await insertBlockDontWaitForInsertClose( block.name );
|
||||
expect( await getAllBlocks() ).toHaveLength( 2 );
|
||||
} );
|
||||
|
||||
it( 'renders without crashing', async () => {
|
||||
await expect( page ).toRenderBlock( block );
|
||||
} );
|
||||
} );
|
Loading…
Reference in New Issue