Skip to content

test(integration): Fix array tests using asymetric matcher#1992

Merged
olivermrbl merged 5 commits intodevelopfrom
fix/integration-test-on-array
Aug 7, 2022
Merged

test(integration): Fix array tests using asymetric matcher#1992
olivermrbl merged 5 commits intodevelopfrom
fix/integration-test-on-array

Conversation

@adrien2p
Copy link
Copy Markdown
Contributor

@adrien2p adrien2p commented Aug 4, 2022

What
From time to time the tests are failing when it comes to validate a collection of objects.

How
Already, when the endpoint use a transformer, it order the resources by default. Which is not the case for non migrated endpoint.
Also, when checking nested object using asymetricMatcher, we add an array asymetricMatcher as well.

FIXES CORE-340

@adrien2p adrien2p self-assigned this Aug 4, 2022
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 4, 2022

🦋 Changeset detected

Latest commit: d347639

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@adrien2p adrien2p marked this pull request as ready for review August 4, 2022 10:58
@adrien2p adrien2p requested a review from a team as a code owner August 4, 2022 10:58
Copy link
Copy Markdown
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

This is a super nice cleanup 💪

Going forward we should make sure to always assert on array length in case we only expect a single item otherwise we would get a false positive with array matchers.

@adrien2p
Copy link
Copy Markdown
Contributor Author

adrien2p commented Aug 5, 2022

This is a super nice cleanup 💪

Going forward we should make sure to always assert on array length in case we only expect a single item otherwise we would get a false positive with array matchers.

Yes true, I did it for some of them already, but then I did stop. I can do another commit to check those wdyt?

@olivermrbl
Copy link
Copy Markdown
Contributor

olivermrbl commented Aug 5, 2022

I can do another commit to check those wdyt?

That would be awesome, but do you have an overview of what tests need that assertion?

@adrien2p
Copy link
Copy Markdown
Contributor Author

adrien2p commented Aug 5, 2022

I can do another commit to check those wdyt?

That would be awesome, but do you have an overview of what tests that need to add that assertion to?

I ll base that on the snapshot and the content of the tests as usual 😀

@olivermrbl
Copy link
Copy Markdown
Contributor

I ll base that on the snapshot and the content of the tests as usual

That would be super nice (and comforting)!

@olivermrbl olivermrbl force-pushed the fix/integration-test-on-array branch from 565055e to 5c3b4a9 Compare August 5, 2022 12:09
@olivermrbl olivermrbl merged commit b3b69d7 into develop Aug 7, 2022
@olivermrbl olivermrbl deleted the fix/integration-test-on-array branch August 7, 2022 09:50
carlos-r-l-rodrigues pushed a commit that referenced this pull request Aug 22, 2022
…1992)

feat(medusa): Convert CollectionService to TypeScript (#1976)

feat(medusa): Convert OauthService to TypeScript (#1983)

feat(medusa-js): Add Collection batch (remove, add) endpoints (#1958)

feat(medusa-react): Add Collection batch (remove, add) endpoints (#1959)

feat(medusa-payment-stripe): Add support for Przelewy24 and Blik (#1982)

feat(medusa): Convert ShippingProfileService to TypeScript (#1963)

feat(medusa): Use transactions in CartCompletionStrategy (#1968)

feat(medusa): Convert IdempotencyKeyService to TypeScript (#1995)

* feat(medusa): Migrate the idempotency key service to ts + fix

* feat(medusa): Finalise idempotency migration

* Create late-owls-pump.md

* feat(medusa): Polish

* feat(medusa): Add case to the error handler

* feat(medusa): Add case to the error handler

Co-authored-by: olivermrbl <[email protected]>

feat(medusa,medusa-telemetry): Add telemetry on feature flags (#2017)

chore(medusa): Feature flag loader simplify, deduplicate and increase readability (#2025)

feat(medusa:) Convert PaymentProvider + PaymentProviderInterface to TS +  (#1773)

* feat(payments): Refactor core Payment related

* fix(medusa): typings

* test(unit): fix suite

* test(unit): fix suite

* feat(medusa): Improve payment provider container typings

* fix(medusa): typings

* styles(medusa): renove comments

* feat(medusa): cleanup

* feat(medusa): Add uniq constraint on payment session and idem key on create-payment-session end point

* fix(medusa): migration

* fix(medusa): create payment session

* feat(medusa): cleanup

feat(medusa): Refactor undefined check into a single util (#2024)

chore(medusa): Remove intepestive services re instanciation in loop (#2036)

* chore(medusa): Renove intepestive services re instanciation in loop

* test(medusa): Fix missing deps

* fix(medusa): Missing await

feat(medusa): Simplify the transaction base service (#2007)

**What**
Simplify the transaction base service.

**How**

In fact, it does not need to be template and reduce the extensibility as the type is internally enforce. Now, the type is deduced by this which can be any derived class.

fix(medusa): join tracking links to all fulfillments in admin/orders (#2045)

Fixes #2042

feat(medusa): Implement the SC migration scripts (#2037)

**What**
Migrate the existing products to the default sales channel

FIXES CORE-434

fix(medusa): Complete cart with 100% discount (#2032)

**What**
Naive fix to allow carts with 100% discount to be completed.

**Why**
Discount total is wrongly calculated if `items` and `items.adjustments` is not included in relations upon retrieving the cart.

**Thought**
This is yet another example of why we need to rethink and refactor totals computation to not depend on what is provided by the user.

fix(medusa-payment-stripe): Add item adjustments relation in CartSubcriber (#2052)

added upgrade guide for v1.3.6

Revert "added upgrade guide for v1.3.6"

This reverts commit 9c3c8cb.

feat(medusa): Migrate Return service to ts (#1926)

feat(medusa): Add Mongolian currency tugrug (#2067)

tests(integration-tests): Allow null updates in discounts (#1299)

feat(medusa): Filtering Customer Orders (#975)

feat(medusa-js): Add deleteSession endpoint (#1234)
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.

2 participants