Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only be inserted once test excludes the mini-cart template button #46478

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ const blockData: BlockData = {
slug: 'woocommerce/mini-cart',
mainClass: '.wc-block-minicart',
selectors: {
editor: {
block: '.wp-block-woocommerce-mini-cart',
insertButton: "//button//span[text()='Mini-Cart']",
},
frontend: {},
editor: {},
},
};

Expand Down Expand Up @@ -54,15 +57,19 @@ test.describe( 'Merchant → Mini Cart', () => {
.getByLabel( 'Search for blocks and patterns' )
.fill( blockData.slug );

// Await for blocks commercial to be loaded in the Blocks inserter.
await expect(
editorUtils.page.locator(
'.block-directory-downloadable-block-list-item__details'
)
).toBeVisible();
nielslange marked this conversation as resolved.
Show resolved Hide resolved

const miniCartButton = editorUtils.page.getByRole( 'option', {
name: blockData.name,
exact: true,
} );

await expect( miniCartButton ).toHaveAttribute(
'aria-disabled',
'true'
);
await expect( miniCartButton ).toBeVisible();
await expect( miniCartButton ).toBeDisabled();
} );
} );
} );
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/fix-mini-cart-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

can only be inserted once excludes the mini-cart template button