Add e2e tests for Top Rated Products (https://github.com/woocommerce/woocommerce-blocks/pull/4786)
This commit is contained in:
parent
eb9b8ab233
commit
8475bc7bad
|
@ -0,0 +1 @@
|
|||
{"title":"Top Rated Products Block","pageContent":"<!-- wp:woocommerce/product-top-rated /-->"}
|
|
@ -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: 'Top Rated Products',
|
||||
slug: 'woocommerce/product-top-rated',
|
||||
class: '.wc-block-product-top-rated',
|
||||
};
|
||||
|
||||
describe( `${ block.name } Block`, () => {
|
||||
beforeAll( async () => {
|
||||
await switchUserToAdmin();
|
||||
await visitBlockPage( `${ block.name } Block` );
|
||||
} );
|
||||
|
||||
it( 'renders without crashing', async () => {
|
||||
await expect( page ).toRenderBlock( block );
|
||||
} );
|
||||
|
||||
it( 'can be inserted more than once', async () => {
|
||||
await insertBlockDontWaitForInsertClose( block.name );
|
||||
expect( await getAllBlocks() ).toHaveLength( 2 );
|
||||
} );
|
||||
} );
|
Loading…
Reference in New Issue