update per feedback, add spacing, remove unused function
This commit is contained in:
parent
8cbb606c7e
commit
76332ec0c8
|
@ -30,26 +30,6 @@ const VirtualProductName = 'Virtual Product Name';
|
|||
const NonVirtualProductName = 'Non-Virtual Product Name';
|
||||
const simpleProductPrice = config.has('products.simple.price') ? config.get('products.simple.price') : '9.99';
|
||||
|
||||
const verifyPublishAndTrash = async () => {
|
||||
// Wait for auto save
|
||||
await page.waitFor( 2000 );
|
||||
|
||||
// Publish product
|
||||
await expect( page ).toClick( '#publish' );
|
||||
await page.waitForSelector( '.updated.notice', { text: 'Product published.' } );
|
||||
|
||||
// Verify
|
||||
await expect( page ).toMatchElement( '.updated.notice', { text: 'Product published.' } );
|
||||
await page.waitForSelector( 'a', { text: 'Move to Trash' } );
|
||||
|
||||
// Trash product
|
||||
await expect( page ).toClick( 'a', { text: 'Move to Trash' } );
|
||||
await page.waitForSelector( '.updated.notice', { text: '1 product moved to the Trash.' } );
|
||||
|
||||
// Verify
|
||||
await expect( page ).toMatchElement( '.updated.notice', { text: '1 product moved to the Trash.' } );
|
||||
};
|
||||
|
||||
const openNewProductAndVerify = async () => {
|
||||
// Go to "add product" page
|
||||
await merchant.openNewProduct();
|
||||
|
@ -221,7 +201,7 @@ const runAddVariableProductTest = () => {
|
|||
|
||||
await page.focus('button.save-variation-changes');
|
||||
await expect(page).toClick('button.save-variation-changes', {text: 'Save changes'});
|
||||
// @todo: add one or more tests to verify changes were saved
|
||||
// @todo: https://github.com/woocommerce/woocommerce/issues/30580
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
@ -13,8 +13,8 @@ const updateReadyPageStatus = async ( status ) => {
|
|||
const wpPagesEndpoint = '/wp/v2/pages';
|
||||
const adminUsername = testConfig.users.admin.username ? testConfig.users.admin.username : 'admin';
|
||||
const adminPassword = testConfig.users.admin.password ? testConfig.users.admin.password : 'password';
|
||||
const client = HTTPClientFactory.build(apiUrl)
|
||||
.withBasicAuth(adminUsername, adminPassword)
|
||||
const client = HTTPClientFactory.build( apiUrl )
|
||||
.withBasicAuth( adminUsername, adminPassword )
|
||||
.create();
|
||||
|
||||
// As the default status filter in the API is `publish`, we need to
|
||||
|
@ -25,11 +25,11 @@ const updateReadyPageStatus = async ( status ) => {
|
|||
statusFilter = 'draft';
|
||||
}
|
||||
|
||||
const getPostsResponse = await client.get(`${wpPagesEndpoint}?search=ready&status=${statusFilter}` );
|
||||
const getPostsResponse = await client.get( `${wpPagesEndpoint}?search=ready&status=${statusFilter}` );
|
||||
if ( getPostsResponse.data && getPostsResponse.data.length > 0 ) {
|
||||
const pageId = getPostsResponse.data[0].id;
|
||||
// Update the page to the new status
|
||||
await client.put(`${wpPagesEndpoint}/${pageId}`, { 'status': status } );
|
||||
await client.post( `${wpPagesEndpoint}/${pageId}`, { 'status': status } );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue