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

Wisdom v3 #1002

Closed
wants to merge 23 commits into from
Closed

Wisdom v3 #1002

wants to merge 23 commits into from

Conversation

arenoir
Copy link

@arenoir arenoir commented Feb 17, 2025

No description provided.

kdaviduik and others added 23 commits January 15, 2025 20:09
Co-authored-by: Juan P. Prieto <jp@calltheguys.co>
Before these tests weren't actually testing anything useful  -
the API response was mocked, and then the test ensured that the
mock returned the return value we mocked.

Now these tests execute actual storefront API calls, and are
now useful integration tests that we can trust.
The goal of this commit is to isolate the non-test, non-doc code changes
to be reviewed.

This commit contains:
- Changes to the GQL operations used in the checkout resource
- Input and payload mapping to match the previous inputs/payloads
as closely as possible

This commit does NOT contain:
- Unit tests
- Integration tests
- Migration guide
- Docs updates

Co-authored-by: Juan P. Prieto <jp@calltheguys.co>
In cart-payload-mapper-test, these are just unit tests.

All of the other tests make actual SF API calls and verify that the response
returned from the SDK is what we expect. Our goal here is to ensure
that when a given checkout method is called with SDK v3, the response
is the same as what previous versions of the SDK returned (aside from
known/documented discrepancies between the cart/checkout APIs).

In the tests, the "expected" values are all values that we got when
we ran these operations with the previous SDK version. The "actual"
values are what v3 of the SDK returns for the same operation.

Co-authored-by: Juan P. Prieto <jp@calltheguys.co>
Co-authored-by: Juan P. Prieto <jp@calltheguys.co>
Fix table formatting
This property is added on by the GraphQL JS client. `hasPreviousPage`
was coming out as true and `hasNextPage` was coming out as false,
but since we fetch all pages and give them back as a single array,
those values are misleading, so now we're hard-coding them both to
false.
As a sanity check during the development phase, we were throwing
an error if we were aware of a discount code but it wasn't appearing
in the output of our discount mapping. Upon investigating further, we
determined that this is expected behaviour for any discount codes that
are applied but have `applicable: false`. Therefore, we are updating
our sanity check to only throw an error if the discount code IS applied
but somehow didn't get mapped.

These sanity checks that throw errors will be removed before release.
The assertions were slightly off, since the item is $70 rather than $73.5.
@arenoir arenoir closed this Feb 17, 2025
@arenoir arenoir deleted the wisdom-v3 branch February 17, 2025 18:54
@arenoir
Copy link
Author

arenoir commented Feb 17, 2025

sorry wrong repo

@arenoir arenoir restored the wisdom-v3 branch February 17, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants