Skip to content

Commit aac021d

Browse files
committed
fix: tests
1 parent b920f14 commit aac021d

File tree

4 files changed

+53
-5
lines changed

4 files changed

+53
-5
lines changed

packages/spec/markets/__snapshots__/reserve.spec.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ exports[`Given an Aave Market reserve > When fetching the reserve data > Then it
99
"eModeInfo": Any<Array>,
1010
"flashLoanEnabled": true,
1111
"incentives": [],
12+
"interestRateStrategyAddress": Any<String>,
1213
"isFrozen": false,
1314
"isPaused": false,
1415
"isolationModeConfig": null,

packages/spec/markets/reserve.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe('Given an Aave Market reserve', () => {
4545
assertOk(result);
4646
expect(result.value).toMatchSnapshot({
4747
aToken: expect.any(Object),
48+
interestRateStrategyAddress: expect.any(String),
4849
underlyingToken: {
4950
address: ETHEREUM_WETH_ADDRESS,
5051
},

packages/spec/vaults/__snapshots__/vaults.spec.ts.snap

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

3+
exports[`Given the Aave Vaults > And a deployed organization vault > When the organization wants to manage the vault > Then the organization should be able to modify the recipients of the vault 1`] = `
4+
[
5+
{
6+
"__typename": "VaultFeesRecipientSplit",
7+
"address": "0x1234567890123456789012345678901234567890",
8+
"isAaveLabs": false,
9+
"split": {
10+
"__typename": "PercentValue",
11+
"decimals": 4,
12+
"formatted": "25.00",
13+
"raw": "2500",
14+
"value": "0.25",
15+
},
16+
},
17+
{
18+
"__typename": "VaultFeesRecipientSplit",
19+
"address": "0x1234567890123456789012345678901234567891",
20+
"isAaveLabs": false,
21+
"split": {
22+
"__typename": "PercentValue",
23+
"decimals": 4,
24+
"formatted": "25.00",
25+
"raw": "2500",
26+
"value": "0.25",
27+
},
28+
},
29+
{
30+
"__typename": "VaultFeesRecipientSplit",
31+
"address": "0xbA3Fa06E181D4a64B07D0ed0e8369811F0aD44BA",
32+
"isAaveLabs": true,
33+
"split": {
34+
"__typename": "PercentValue",
35+
"decimals": 4,
36+
"formatted": "50.00",
37+
"raw": "5000",
38+
"value": "0.50",
39+
},
40+
},
41+
]
42+
`;
43+
344
exports[`Given the Aave Vaults > And a deployed organization vault > When the user redeems partial amount of their shares > Then the user's vault activity can be fetched for the time window LAST_MONTH 1`] = `
445
{
546
"__typename": "VaultUserActivityResult",

packages/spec/vaults/vaults.spec.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
getBalance,
4242
} from '@aave/client/test-utils';
4343
import { sendWith } from '@aave/client/viem';
44-
import { beforeAll, describe, expect, it } from 'vitest';
44+
import { beforeAll, beforeEach, describe, expect, it } from 'vitest';
4545
import {
4646
createVault,
4747
depositOntoVault,
@@ -150,10 +150,9 @@ describe('Given the Aave Vaults', () => {
150150
describe('And a deployed organization vault', () => {
151151
describe('When the organization wants to manage the vault', () => {
152152
const organization = createNewWallet();
153-
const newOwner = createNewWallet();
154153
let initialVault: Vault;
155154

156-
beforeAll(async () => {
155+
beforeEach(async () => {
157156
const setup = await fundErc20Address(
158157
ETHEREUM_WETH_ADDRESS,
159158
evmAddress(organization.account!.address),
@@ -199,8 +198,11 @@ describe('Given the Aave Vaults', () => {
199198
it('Then the organization should be able to transfer the ownership of the vault', async ({
200199
annotate,
201200
}) => {
201+
const newOwner = createNewWallet();
202202
annotate(`organization address: ${organization.account!.address}`);
203203
annotate(`initial vault: ${initialVault.address}`);
204+
annotate(`new owner address: ${newOwner.account!.address}`);
205+
204206
const transferResult = await vaultTransferOwnership(client, {
205207
vault: initialVault.address,
206208
chainId: initialVault.chainId,
@@ -248,7 +250,6 @@ describe('Given the Aave Vaults', () => {
248250
}) => {
249251
const newRecipient1 = '0x1234567890123456789012345678901234567890';
250252
const newRecipient2 = '0x1234567890123456789012345678901234567891';
251-
252253
const newRecipients = [
253254
{
254255
address: evmAddress(newRecipient1),
@@ -259,6 +260,7 @@ describe('Given the Aave Vaults', () => {
259260
percent: bigDecimal('50'),
260261
},
261262
];
263+
262264
const updateResult = await vaultCreateRecipientsConfiguration(client, {
263265
chainId: initialVault.chainId,
264266
vault: initialVault.address,
@@ -274,6 +276,9 @@ describe('Given the Aave Vaults', () => {
274276
}),
275277
)
276278
.map(nonNullable)
279+
.andTee((recipientConfig) =>
280+
console.log(`recipient config: ${recipientConfig.address}`),
281+
)
277282
.andThen((recipientConfig) =>
278283
vaultSetRecipientsConfiguration(client, {
279284
vault: initialVault.address,
@@ -292,7 +297,7 @@ describe('Given the Aave Vaults', () => {
292297
}).map(nonNullable);
293298
assertOk(newVaultInfo);
294299
expect(newVaultInfo.value.recipients?.entries).toMatchSnapshot();
295-
});
300+
}, 50_000);
296301
});
297302

298303
describe('When a user deposits into the vault', () => {

0 commit comments

Comments
 (0)