Skip to content

Commit

Permalink
Re-enable shopping product test
Browse files Browse the repository at this point in the history
See #11989
  • Loading branch information
swissspidy committed Oct 7, 2022
1 parent 9fee29e commit 44879a0
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/e2e-tests/src/specs/editor/shopping/productMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,38 @@ jest.retryTimes(2, { logErrorsBeforeRetry: true });

describe('Shopping product', () => {
minWPVersionRequired('5.8');

describe('Product menu', () => {
withPlugin('woocommerce');

beforeAll(async () => {
await setShoppingProvider('WooCommerce');
});

function isStoryEmpty() {
return page.evaluate(() => {
// checks for a blank canvas / empty state i.e. no products exist
if (document.getElementById('emptystate-message')) {
return true;
}
return false;
});
return page.evaluate(() =>
Boolean(document.getElementById('emptystate-message'))
);
}
//eslint-disable-next-line jest/no-disabled-tests -- TODO(#11989): Fix flakey test.
it.skip('should show a floating menu with product dropdown', async () => {

it('should show a floating menu with product dropdown', async () => {
const productText = 'Hoodie with Zipper';

await createNewStory();
await expect(isStoryEmpty()).resolves.toBe(true);

await insertProduct(productText);
await expect(isStoryEmpty()).resolves.toBe(false);

await page.waitForSelector(
'[aria-label="Design menu"] [aria-label="Product"]'
);

await expect(page).toMatchElement(
'[aria-label="Design menu"] [aria-label="Product"]',
{ text: productText }
);

await expect(page).toClick('button', { text: 'Remove product' });
await expect(isStoryEmpty()).resolves.toBe(true);
});
Expand Down

0 comments on commit 44879a0

Please sign in to comment.