Skip to content

Update Reviews blocks tests so they catch errors with the API #42065

@Aljullu

Description

@Aljullu

Our e2e tests for the Reviews blocks didn't catch woocommerce/woocommerce-blocks#11912. That's because they test for selectors like .wc-block-review-list .wc-block-review-list-item__item:not(.is-loading) to verify the block rendered properly in the editor, but an element matching that selector is rendered even if the Rest API returns an error.

Ideally, our tests should check that the block finished loading and is showing a real review, so instead of checking for a selector, they should probably check for the review text to be displayed.

We could also take the chance to rewrite the tests in Playwright.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions