Skip to content

Commit 689ff18

Browse files
committed
fix: tests
1 parent 2506eab commit 689ff18

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

src/tests/other-tests.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,13 @@ describe('other tests', () => {
141141
expect(result1.status).toBe(200);
142142
expect(result1.type).toBe('application/json');
143143
const expectedResp1 = {
144-
unlocked_percent: '12.93',
145-
total_stx: '1818000000.000000',
146-
unlocked_stx: microStxToStx(expectedTotalStx1),
147-
block_height: dbBlock1.block_height,
144+
unlocked_percent: '100.00',
145+
total_stx: '235000000.000000',
146+
total_stx_year_2050: '1818000000.000000',
147+
unlocked_stx: '235000000.000000',
148+
block_height: 1,
148149
};
150+
149151
expect(JSON.parse(result1.text)).toEqual(expectedResp1);
150152

151153
// ensure burned STX reduce the unlocked stx supply
@@ -166,9 +168,10 @@ describe('other tests', () => {
166168
expect(result2.status).toBe(200);
167169
expect(result2.type).toBe('application/json');
168170
const expectedResp2 = {
169-
unlocked_percent: '12.38',
170-
total_stx: '1818000000.000000',
171+
unlocked_percent: '100.00',
172+
total_stx: microStxToStx(expectedTotalStx2),
171173
unlocked_stx: microStxToStx(expectedTotalStx2),
174+
total_stx_year_2050: '1818000000.000000',
172175
block_height: dbBlock1.block_height,
173176
};
174177
expect(JSON.parse(result2.text)).toEqual(expectedResp2);
@@ -197,8 +200,9 @@ describe('other tests', () => {
197200
expect(result3.status).toBe(200);
198201
expect(result3.type).toBe('application/json');
199202
const expectedResp3 = {
200-
unlocked_percent: '13.20',
201-
total_stx: '1818000000.000000',
203+
unlocked_percent: '100.00',
204+
total_stx: microStxToStx(expectedTotalStx3),
205+
total_stx_year_2050: '1818000000.000000',
202206
unlocked_stx: microStxToStx(expectedTotalStx3),
203207
block_height: dbBlock1.block_height,
204208
};
@@ -207,7 +211,7 @@ describe('other tests', () => {
207211
const result4 = await supertest(api.server).get(`/extended/v1/stx_supply/total/plain`);
208212
expect(result4.status).toBe(200);
209213
expect(result4.type).toBe('text/plain');
210-
expect(result4.text).toEqual('1818000000.000000');
214+
expect(result4.text).toEqual('240000000.000000');
211215

212216
const result5 = await supertest(api.server).get(`/extended/v1/stx_supply/circulating/plain`);
213217
expect(result5.status).toBe(200);
@@ -219,13 +223,17 @@ describe('other tests', () => {
219223
expect(result6.status).toBe(200);
220224
expect(result6.type).toBe('application/json');
221225
const expectedResp6 = {
222-
unlockedPercent: '13.20',
223-
totalStacks: '1818000000.000000',
224-
totalStacksFormatted: '1,818,000,000.000000',
226+
unlockedPercent: '100.00',
227+
totalStacks: microStxToStx(expectedTotalStx3),
228+
totalStacksFormatted: new Intl.NumberFormat('en', {
229+
minimumFractionDigits: STACKS_DECIMAL_PLACES,
230+
}).format(parseInt(microStxToStx(expectedTotalStx3))),
225231
unlockedSupply: microStxToStx(expectedTotalStx3),
226232
unlockedSupplyFormatted: new Intl.NumberFormat('en', {
227233
minimumFractionDigits: STACKS_DECIMAL_PLACES,
228234
}).format(parseInt(microStxToStx(expectedTotalStx3))),
235+
totalStacksYear2050: '1818000000.000000',
236+
totalStacksYear2050Formatted: '1,818,000,000.000000',
229237
blockHeight: dbBlock1.block_height.toString(),
230238
};
231239
expect(JSON.parse(result6.text)).toEqual(expectedResp6);

0 commit comments

Comments
 (0)