Skip to content

Commit 28e711b

Browse files
authored
fix: disable native tests and refactor balances scenarios (#188)
1 parent 1e9691b commit 28e711b

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

packages/spec/supply/business.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ describe('Supplying Assets on Aave V4', () => {
297297
});
298298
});
299299

300-
describe('Given a user and a reserve that supports native token deposits', () => {
300+
// TODO: Enable when we have a test fork that allow us to control
301+
describe.skip('Given a user and a reserve that supports native token deposits', () => {
301302
describe('When the user wants to preview the supply action before performing it', () => {
302303
it('Then the user can review the supply details before proceeding', async () => {
303304
const amountToSupply = bigDecimal('0.01');

packages/spec/tools/balances.spec.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import {
88
ETHEREUM_HUB_CORE_ADDRESS,
99
ETHEREUM_SPOKE_CORE_ADDRESS,
1010
ETHEREUM_USDC_ADDRESS,
11-
ETHEREUM_USDS_ADDRESS,
1211
fundErc20Address,
1312
} from '@aave/client/test-utils';
1413
import { beforeAll, describe, expect, it } from 'vitest';
15-
import { assertSingleElementArray } from '../test-utils';
14+
import { findReserveAndSupply } from '../helpers/supplyBorrow';
15+
import { assertNonEmptyArray } from '../test-utils';
1616

1717
const user = await createNewWallet(
18-
'0x175ed519142afcfa12443d747712983ab3203cc24f7afc3a9fb2b521e635f4ba',
18+
'0xb648cc3d9bdad37b60bcd7177b783a9c7ddfb36b6c7699f74f8dd27d4d150503',
1919
);
2020

2121
// Get the user balances for the protocol. This will only return assets that can be used on the protocol
@@ -31,19 +31,21 @@ describe('Querying User Balances on Aave V4', () => {
3131
},
3232
});
3333
assertOk(balances);
34-
if (balances.value.length < 4) {
35-
for (const token of [
36-
ETHEREUM_USDC_ADDRESS,
37-
ETHEREUM_USDS_ADDRESS,
38-
ETHEREUM_1INCH_ADDRESS,
39-
]) {
34+
if (balances.value.length < 3) {
35+
for (const token of [ETHEREUM_USDC_ADDRESS, ETHEREUM_1INCH_ADDRESS]) {
4036
const result = await fundErc20Address(
4137
evmAddress(user.account.address),
4238
{
4339
address: token,
4440
amount: bigDecimal('100'),
4541
decimals: token === ETHEREUM_1INCH_ADDRESS ? 18 : 6,
4642
},
43+
).andThen(() =>
44+
findReserveAndSupply(client, user, {
45+
token: token,
46+
amount: bigDecimal('50'),
47+
asCollateral: true,
48+
}),
4749
);
4850
assertOk(result);
4951
}
@@ -77,7 +79,8 @@ describe('Querying User Balances on Aave V4', () => {
7779
},
7880
});
7981
assertOk(balances);
80-
expect(balances.value.length).toBe(3);
82+
// NOTE: One less because 1INCH is not supported on the hub
83+
expect(balances.value.length).toBe(2);
8184
});
8285
});
8386

@@ -93,7 +96,8 @@ describe('Querying User Balances on Aave V4', () => {
9396
},
9497
});
9598
assertOk(balances);
96-
expect(balances.value.length).toBe(3);
99+
// NOTE: One less because 1INCH is not supported on the spoke
100+
expect(balances.value.length).toBe(2);
97101
});
98102
});
99103

@@ -122,7 +126,7 @@ describe('Querying User Balances on Aave V4', () => {
122126
},
123127
});
124128
assertOk(positions);
125-
assertSingleElementArray(positions.value);
129+
assertNonEmptyArray(positions.value);
126130
const balances = await userBalances(client, {
127131
user: evmAddress(user.account.address),
128132
filter: {
@@ -132,7 +136,7 @@ describe('Querying User Balances on Aave V4', () => {
132136
},
133137
});
134138
assertOk(balances);
135-
expect(balances.value.length).toBe(3);
139+
expect(balances.value.length).toBe(2);
136140
});
137141
});
138142

packages/spec/withdraw/business.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ describe('Withdrawing Assets on Aave V4', () => {
169169
});
170170
});
171171

172-
describe('Given a user and a reserve that supports withdrawals in native tokens', () => {
172+
// TODO: Enable when we have a test fork that allow us to control
173+
describe.skip('Given a user and a reserve that supports withdrawals in native tokens', () => {
173174
let reserveSupportingNative: Reserve;
174175
const amountToSupply = bigDecimal(0.05);
175176

0 commit comments

Comments
 (0)