@W-18598001 improve order history test coverage#2521
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
patricksullivansf
left a comment
There was a problem hiding this comment.
Tests seem well written. I have some nits to consider but no blockers. Cool!
packages/template-retail-react-app/app/pages/account/orders.test.js
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/pages/account/orders.test.js
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/pages/account/orders.test.js
Outdated
Show resolved
Hide resolved
sf-emmyzhang
left a comment
There was a problem hiding this comment.
I had a few suggestions for updating the tests, which as currently written seems more like integration tests to me. Maybe more specificity about what's being tested through the description by clearly defining the expected behavior and separating different cases into distinct tests. This will not only make it easier to identify failures in test reports, but also for us to read, debug, and update.
| expect(await screen.findByTestId('account-order-details-page')).toBeInTheDocument() | ||
| expect(window.location.pathname).toMatch(new RegExp(`/account/orders/${orderNo}$`)) | ||
|
|
||
| // Click the back link |
There was a problem hiding this comment.
We don't want to have comment explain the "how", mostly to use it to explain the "why". I assumed these are generated from AI?
There was a problem hiding this comment.
removed unnecessary comment
| describe('Handles order with missing or partial data gracefully', () => { | ||
| let orderNo | ||
| beforeEach(async () => { | ||
| const partialOrder = { |
There was a problem hiding this comment.
I am wondering if this is a real case scenario. From the storefront, if you don't input your billing shipment or payment, you will never be able to check out and place an order. I think the API will not allow you to check out without these missing information either.
There was a problem hiding this comment.
Understood but the get api could have a bug in it.
Description
Adding in additional tests into order history before making additional changes for bonus product.
Types of Changes
Changes
How to Test-Drive This PR
npm test -- app/pages/account/orders.test.jsChecklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization