Fix: Attribute filter flaky test (https://github.com/woocommerce/woocommerce-blocks/pull/6862)
This commit is contained in:
parent
02ce62109e
commit
dc66942cbb
|
@ -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 ),
|
||||
|
|
Loading…
Reference in New Issue