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

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

Closed
Aljullu opened this issue Nov 23, 2023 · 1 comment · Fixed by #42903
Closed

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

Aljullu opened this issue Nov 23, 2023 · 1 comment · Fixed by #42903
Assignees
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

Comments

@Aljullu
Copy link
Contributor

Aljullu commented Nov 23, 2023

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.

@Aljullu Aljullu added the block-type: reviews Issues related to all of the reviews related blocks. label Nov 23, 2023
@Aljullu
Copy link
Contributor Author

Aljullu commented Nov 23, 2023

We should also improve the tests so they catch issues with the Order by <select>. See: woocommerce/woocommerce-blocks#11917.

@Aljullu Aljullu added block: reviews by product Issues related to the Reviews by Product block. block: reviews by category Issues related to the Reviews by Category block. block: all reviews Issues related to the All Reviews block. and removed block-type: reviews Issues related to all of the reviews related blocks. labels Nov 27, 2023
@Aljullu Aljullu self-assigned this Nov 28, 2023
@nerrad nerrad added the focus: e2e tests Issues related to e2e tests label Nov 29, 2023
@ralucaStan ralucaStan added team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues and removed team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues labels Nov 30, 2023
@ObliviousHarmony ObliviousHarmony transferred this issue from woocommerce/woocommerce-blocks Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
4 participants