-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add spec for EarningsInterface#accountAssetsData (#227)
- Loading branch information
1 parent
6f32db9
commit db88cbe
Showing
5 changed files
with
145 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/test-utils/factories/accountEarningsResponse.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { AccountEarningsResponse } from "../../services/subgraph/responses"; | ||
|
||
export const DEFAULT_ACCOUNT_EARNINGS_RESPONSE: AccountEarningsResponse = { | ||
data: { | ||
account: { | ||
vaultPositions: [ | ||
{ | ||
balanceShares: "1", | ||
token: { | ||
id: "AERTokenId", | ||
decimals: 18 | ||
}, | ||
shareToken: { | ||
symbol: "AER" | ||
}, | ||
updates: [ | ||
{ | ||
deposits: "1", | ||
withdrawals: "2", | ||
tokensReceived: "3", | ||
tokensSent: "4" | ||
} | ||
], | ||
vault: { | ||
id: "AERVaultId" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}; | ||
|
||
export const createMockAccountEarningsResponse = (overwrites: Partial<AccountEarningsResponse> = {}) => ({ | ||
...DEFAULT_ACCOUNT_EARNINGS_RESPONSE, | ||
...overwrites | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Apy } from "../.."; | ||
|
||
export const DEFAULT_APY: Apy = { | ||
type: "apyType", | ||
gross_apr: 2, | ||
net_apy: 3, | ||
fees: { | ||
performance: null, | ||
withdrawal: null, | ||
management: null, | ||
keep_crv: null, | ||
cvx_keep_crv: null | ||
}, | ||
points: null, | ||
composite: null | ||
}; | ||
|
||
export const createMockApy = (overwrites: Partial<Apy> = {}) => ({ | ||
...DEFAULT_APY, | ||
...overwrites | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters