Skip to content

@W-18598001 improve order history test coverage#2521

Merged
sf-kyle-wright merged 5 commits intodevelopfrom
t/cc-shark/W-18598001/improve-coverage-before-change
Jun 10, 2025
Merged

@W-18598001 improve order history test coverage#2521
sf-kyle-wright merged 5 commits intodevelopfrom
t/cc-shark/W-18598001/improve-coverage-before-change

Conversation

@sf-kyle-wright
Copy link
Contributor

@sf-kyle-wright sf-kyle-wright commented Jun 5, 2025

Description

Adding in additional tests into order history before making additional changes for bonus product.

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • Unit Test addtions for order history

How to Test-Drive This PR

  • npm test -- app/pages/account/orders.test.js

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@sf-kyle-wright sf-kyle-wright requested a review from a team as a code owner June 5, 2025 13:25
@sf-kyle-wright sf-kyle-wright added the skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated label Jun 5, 2025
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Jun 5, 2025

🎉 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)

Copy link
Contributor

@patricksullivansf patricksullivansf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests seem well written. I have some nits to consider but no blockers. Cool!

Copy link
Contributor

@sf-emmyzhang sf-emmyzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed unnecessary comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexvuong can you take another look?

Copy link
Contributor

@sf-emmyzhang sf-emmyzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@sf-kyle-wright sf-kyle-wright added the ready for review PR is ready to be reviewed label Jun 6, 2025
@sf-kyle-wright sf-kyle-wright requested a review from a team June 6, 2025 18:18
describe('Handles order with missing or partial data gracefully', () => {
let orderNo
beforeEach(async () => {
const partialOrder = {
Copy link
Contributor

@alexvuong alexvuong Jun 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood but the get api could have a bug in it.

@sf-kyle-wright sf-kyle-wright requested a review from alexvuong June 9, 2025 12:36
@sf-kyle-wright sf-kyle-wright merged commit c70e878 into develop Jun 10, 2025
35 checks passed
@sf-kyle-wright sf-kyle-wright deleted the t/cc-shark/W-18598001/improve-coverage-before-change branch June 10, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PR is ready to be reviewed skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants