This commit is contained in:
Tung Du 2022-08-09 08:30:11 +07:00 committed by GitHub
parent 02ce62109e
commit dc66942cbb
1 changed files with 8 additions and 1 deletions

View File

@ -87,6 +87,8 @@ describe( `${ block.name } Block`, () => {
it( 'should show only products that match the filter', async () => {
const isRefreshed = jest.fn( () => void 0 );
page.on( 'load', isRefreshed );
await page.waitForSelector( selectors.frontend.filter );
await page.click( selectors.frontend.filter );
await waitForAllProductsBlockLoaded();
const products = await page.$$( selectors.frontend.productsList );
@ -119,7 +121,6 @@ describe( `${ block.name } Block`, () => {
);
await canvasEl.click( selectors.editor.doneButton );
await saveTemplate();
await goToShopPage();
} );
afterAll( async () => {
@ -127,6 +128,10 @@ describe( `${ block.name } Block`, () => {
await deleteAllTemplates( 'wp_template_part' );
} );
beforeEach( async () => {
await goToShopPage();
} );
it( 'should render', async () => {
const products = await page.$$(
selectors.frontend.classicProductsList
@ -145,6 +150,8 @@ describe( `${ block.name } Block`, () => {
expect( isRefreshed ).not.toBeCalled();
await page.waitForSelector( selectors.frontend.filter );
await Promise.all( [
page.waitForNavigation(),
page.click( selectors.frontend.filter ),