add backbone unblocking

This commit is contained in:
Ron Rennick 2021-04-26 12:18:40 -03:00
parent b1c6337c49
commit 4208207e9c
2 changed files with 9 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import {
setCheckbox,
unsetCheckbox,
evalAndClick,
clearAndFillInput,
backboneUnblocked,
} from './page-utils';
import factories from './factories';
@ -437,7 +437,7 @@ const addProductToOrder = async ( orderId, productName ) => {
await expect( page ).toClick( 'li[aria-selected="true"]' );
await page.click( '.wc-backbone-modal-content #btn-ok' );
await uiUnblocked();
await backboneUnblocked();
// Verify the product we added shows as a line item now
await expect( page ).toMatchElement( '.wc-order-item-name', { text: productName } );

View File

@ -82,6 +82,13 @@ export const uiUnblocked = async () => {
await page.waitForFunction( () => ! Boolean( document.querySelector( '.blockUI' ) ) );
};
/**
* Wait for backbone blocking to end.
*/
export const backboneUnblocked = async () => {
await page.waitForFunction( () => ! Boolean( document.querySelector( '.wc-backbone-modal' ) ) );
};
/**
* Publish, verify that item was published. Trash, verify that item was trashed.
*