Skip to content

Commit f190e71

Browse files
authored
Merge pull request #18 from aave/feat/market-math-tests
fix: tests
2 parents 5fdcf86 + 4d59d68 commit f190e71

File tree

2 files changed

+9
-28
lines changed

2 files changed

+9
-28
lines changed

packages/client/src/actions/__snapshots__/markets.test.ts.snap

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`Given the Aave Protocol v3 > When fetching a market data for a given address > Then it should be possible to fetch market data for a given address 1`] = `
4-
{
5-
"__typename": "Market",
6-
"address": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
7-
"borrowReserves": Any<Array>,
8-
"chain": {
9-
"__typename": "Chain",
10-
"chainId": 99999999,
11-
"explorerUrl": "https://dashboard.tenderly.co/explorer/vnet/27ff3c60-0e2c-4d46-8190-f5170dc7da8c",
12-
"icon": "https://statics.aave.com/ethereum.svg",
13-
"name": "Forked Ethereum",
14-
},
15-
"eModeCategories": Any<Array>,
16-
"icon": "https://statics.aave.com/ethereum.svg",
17-
"name": "AaveV3ForkedEthereum",
18-
"supplyReserves": Any<Array>,
19-
"totalAvailableLiquidity": Any<String>,
20-
"totalMarketSize": Any<String>,
21-
"userState": null,
22-
}
23-
`;
24-
253
exports[`Given the Aave Protocol v3 > When fetching a market data for a given address > Then it should be possible to fetch market data for a given market address and chain ID 1`] = `
264
{
275
"__typename": "Market",
@@ -47,7 +25,7 @@ exports[`Given the Aave Protocol v3 > When fetching a market data for a given ad
4725
exports[`Given the Aave Protocol v3 > When fetching markets data > Then it should be possible to fetch markets for a given chain ID 1`] = `
4826
{
4927
"__typename": "Market",
50-
"address": "0x0AA97c284e98396202b6A04024F5E2c65026F3c0",
28+
"address": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
5129
"borrowReserves": Any<Array>,
5230
"chain": {
5331
"__typename": "Chain",
@@ -58,7 +36,7 @@ exports[`Given the Aave Protocol v3 > When fetching markets data > Then it shoul
5836
},
5937
"eModeCategories": Any<Array>,
6038
"icon": "https://statics.aave.com/ethereum.svg",
61-
"name": "AaveV3EthereumEtherFi",
39+
"name": "AaveV3Ethereum",
6240
"supplyReserves": Any<Array>,
6341
"totalAvailableLiquidity": Any<String>,
6442
"totalMarketSize": Any<String>,
@@ -69,7 +47,7 @@ exports[`Given the Aave Protocol v3 > When fetching markets data > Then it shoul
6947
exports[`Given the Aave Protocol v3 > When fetching markets data > Then it should be possible to fetch markets for a given chain ID 2`] = `
7048
{
7149
"__typename": "Market",
72-
"address": "0x4e033931ad43597d96D6bcc25c280717730B58B1",
50+
"address": "0x0AA97c284e98396202b6A04024F5E2c65026F3c0",
7351
"borrowReserves": Any<Array>,
7452
"chain": {
7553
"__typename": "Chain",
@@ -80,7 +58,7 @@ exports[`Given the Aave Protocol v3 > When fetching markets data > Then it shoul
8058
},
8159
"eModeCategories": Any<Array>,
8260
"icon": "https://statics.aave.com/ethereum.svg",
83-
"name": "AaveV3EthereumLido",
61+
"name": "AaveV3EthereumEtherFi",
8462
"supplyReserves": Any<Array>,
8563
"totalAvailableLiquidity": Any<String>,
8664
"totalMarketSize": Any<String>,
@@ -91,7 +69,7 @@ exports[`Given the Aave Protocol v3 > When fetching markets data > Then it shoul
9169
exports[`Given the Aave Protocol v3 > When fetching markets data > Then it should be possible to fetch markets for a given chain ID 3`] = `
9270
{
9371
"__typename": "Market",
94-
"address": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
72+
"address": "0x4e033931ad43597d96D6bcc25c280717730B58B1",
9573
"borrowReserves": Any<Array>,
9674
"chain": {
9775
"__typename": "Chain",
@@ -102,7 +80,7 @@ exports[`Given the Aave Protocol v3 > When fetching markets data > Then it shoul
10280
},
10381
"eModeCategories": Any<Array>,
10482
"icon": "https://statics.aave.com/ethereum.svg",
105-
"name": "AaveV3Ethereum",
83+
"name": "AaveV3EthereumLido",
10684
"supplyReserves": Any<Array>,
10785
"totalAvailableLiquidity": Any<String>,
10886
"totalMarketSize": Any<String>,

packages/client/src/actions/eMode.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ describe('Given an Aave Market', () => {
6969

7070
expect(reserve).toMatchObject({
7171
userState: expect.objectContaining({
72+
emode: expect.objectContaining({
73+
categoryId: ETHEREUM_MARKET_ETH_CORRELATED_EMODE_CATEGORY,
74+
}),
7275
canBeCollateral: eModeCategoryReserve?.canBeCollateral ?? false,
7376
canBeBorrowed: eModeCategoryReserve?.canBeBorrowed ?? false,
7477
}),

0 commit comments

Comments
 (0)