Update Reviews blocks tests so they catch errors with the API #42065
Labels
block: all reviews
Issues related to the All Reviews block.
block: reviews by category
Issues related to the Reviews by Category block.
block: reviews by product
Issues related to the Reviews by Product block.
focus: e2e tests
Issues related to e2e tests
team: Kirigami & Origami
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.
The text was updated successfully, but these errors were encountered: