-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmodifyPeriodicDistributions.spec.ts
58 lines (52 loc) · 1.43 KB
/
modifyPeriodicDistributions.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import type { PeriodicDistributionsQueryPayload } from '../../../../graphql/subgraph/vault'
import modifyPeriodicDistributions from './modifyPeriodicDistributions'
describe('modifyPeriodicDistributions', () => {
it('should modify PeriodicDistributions data', () => {
const mockData: PeriodicDistributionsQueryPayload = {
periodicDistributions: [
{
apy: '0.5',
token: '0x9d65ff81a3c488d585bbfb0bfe3c7707c7917f54',
},
{
apy: '0.5',
token: '0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2',
},
{
apy: '0.5',
token: '0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38',
},
{
apy: '1.5',
token: '0x9d65ff81a3c488d585bbfb0bfe3c7707c7917f54',
},
{
apy: '2.5',
token: '0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2',
},
{
apy: '3.5',
token: '0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38',
},
],
}
const expectedOutput = [
{
apy: '2',
token: '0x9d65ff81a3c488d585bbfb0bfe3c7707c7917f54',
},
{
apy: '3',
token: '0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2',
},
{
apy: '4',
token: '0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38',
},
]
const result = modifyPeriodicDistributions({
data: mockData,
})
expect(result).toEqual(expectedOutput)
})
})