Skip to content

Commit

Permalink
test: fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Oct 27, 2023
1 parent 906747d commit 7dec8eb
Showing 1 changed file with 36 additions and 9 deletions.
45 changes: 36 additions & 9 deletions webapp/src/modules/item/sagas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,9 @@ describe('when handling the fetch items request action', () => {
return expectSaga(itemSaga, getIdentity)
.provide([
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
matchers.call.fn(
waitForWalletConnectionAndIdentityIfConnecting
),
undefined
],
[matchers.call.fn(waitForFeatureFlagsToBeLoaded), undefined],
Expand Down Expand Up @@ -491,7 +493,9 @@ describe('when handling the fetch items request action', () => {
return expectSaga(itemSaga, getIdentity)
.provide([
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
matchers.call.fn(
waitForWalletConnectionAndIdentityIfConnecting
),
undefined
],
[matchers.call.fn(waitForFeatureFlagsToBeLoaded), undefined],
Expand Down Expand Up @@ -553,7 +557,11 @@ describe('when handling the fetch items request action', () => {
return expectSaga(itemSaga, getIdentity)
.provide([
[matchers.call.fn(CatalogAPI.prototype.get), fetchResult],
[matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting), undefined],
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
undefined
],
[matchers.call.fn(waitForFeatureFlagsToBeLoaded), undefined],
[select(getWallet), undefined],
[select(getLocation), { pathname }],
[select(getIsMarketplaceServerEnabled), false]
Expand Down Expand Up @@ -581,7 +589,11 @@ describe('when handling the fetch items request action', () => {
[select(getIsMarketplaceServerEnabled), true],
[select(getWallet), undefined],
[matchers.call.fn(CatalogAPI.prototype.get), Promise.reject(anError)],
[matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting), undefined]
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
undefined
],
[matchers.call.fn(waitForFeatureFlagsToBeLoaded), undefined]
])
.put(fetchItemsFailure(anError.message, itemBrowseOptions))
.dispatch(fetchItemsRequest(itemBrowseOptions))
Expand All @@ -595,7 +607,10 @@ describe('when handling the fetch items request action', () => {
return expectSaga(itemSaga, getIdentity)
.provide([
[matchers.call.fn(ItemAPI.prototype.getOne), item],
[matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting), undefined]
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
undefined
]
])
.put(fetchItemSuccess(item))
.put(fetchSmartWearableRequiredPermissionsRequest(item))
Expand All @@ -612,7 +627,10 @@ describe('when handling the fetch items request action', () => {
matchers.call.fn(ItemAPI.prototype.getOne),
Promise.reject(anError)
],
[matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting), undefined]
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
undefined
]
])
.put(
fetchItemFailure(item.contractAddress, item.itemId, anError.message)
Expand Down Expand Up @@ -647,7 +665,10 @@ describe('when handling the fetch trending items request action', () => {
[select(getIsMarketplaceServerEnabled), true],
[matchers.call.fn(ItemAPI.prototype.getTrendings), fetchResult],
[matchers.call.fn(CatalogAPI.prototype.get), fetchResult],
[matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting), undefined]
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
undefined
]
])
.put(fetchTrendingItemsSuccess(fetchResult.data))
.dispatch(fetchTrendingItemsRequest())
Expand All @@ -663,7 +684,10 @@ describe('when handling the fetch trending items request action', () => {
.provide([
// [select(getIsMarketplaceServerEnabled), true],
[matchers.call.fn(ItemAPI.prototype.getTrendings), fetchResult],
[matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting), undefined]
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
undefined
]
])
.put(fetchTrendingItemsSuccess(fetchResult.data))
.dispatch(fetchTrendingItemsRequest())
Expand All @@ -680,7 +704,10 @@ describe('when handling the fetch trending items request action', () => {
matchers.call.fn(ItemAPI.prototype.getTrendings),
Promise.reject(anError)
],
[matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting), undefined]
[
matchers.call.fn(waitForWalletConnectionAndIdentityIfConnecting),
undefined
]
])
.put(fetchTrendingItemsFailure(anError.message))
.dispatch(fetchTrendingItemsRequest())
Expand Down

0 comments on commit 7dec8eb

Please sign in to comment.