Skip to content

Commit

Permalink
feat: added deleted old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinBattilana committed Oct 22, 2024
1 parent 91c7d16 commit b9eef23
Showing 1 changed file with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ describe('UiPoolDataProvider', () => {
});
});
});
describe('getUserReservesData', () => {
it('should throw when lendingPoolAddressProvider is not valid address', async () => {
describe('getUserReservesHumanized', () => {
it('should throw if lendingPoolAddressProvider is not a valid ethereum address', async () => {
const instance = createValidInstance();
await expect(
instance.getUserReservesData({
instance.getUserReservesHumanized({
lendingPoolAddressProvider: mockInvalidEthereumAddress,
user: mockValidEthereumAddress,
}),
Expand All @@ -287,21 +287,31 @@ describe('UiPoolDataProvider', () => {
it('should throw if user is not a valid ethereum address', async () => {
const instance = createValidInstance();
await expect(
instance.getUserReservesData({
instance.getUserReservesHumanized({
lendingPoolAddressProvider: mockValidEthereumAddress,
user: mockInvalidEthereumAddress,
}),
).rejects.toThrow('User address is not a valid ethereum address');
});

it('should not throw if user is a valid ethereum address', async () => {
it('should be ok', async () => {
const instance = createValidInstance();
await expect(
instance.getUserReservesData({
lendingPoolAddressProvider: mockValidEthereumAddress,
user: mockValidEthereumAddress,
}),
).resolves.not.toThrow();
const result = await instance.getUserReservesHumanized({
lendingPoolAddressProvider: mockValidEthereumAddress,
user: mockValidEthereumAddress,
});

expect(result).toEqual({
userReserves: [
{
id: '137-0x88757f2f99175387ab4c6a4b3067c77a695b0349-0xb597cd8d3217ea6477232f9217fa70837ff667af-0x88757f2f99175387ab4c6a4b3067c77a695b0349',
scaledATokenBalance: '0',
scaledVariableDebt: '0',
underlyingAsset: '0xb597cd8d3217ea6477232f9217fa70837ff667af',
usageAsCollateralEnabledOnUser: false,
},
],
userEmodeCategoryId: 1,
});
});
});
describe('getEModes', () => {
Expand Down

0 comments on commit b9eef23

Please sign in to comment.