Skip to content

Commit

Permalink
feat: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fum-is-chum committed Dec 30, 2024
1 parent f0341d7 commit aa0079e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,32 @@ describe('Test Scallop Utils', async () => {
expect(vsuiMarketCoinType).toEqual(vsuiAssertMarketCoinType);
});

it('Should parse to scoin type from coin name', () => {
SUPPORT_SCOIN.forEach((t) => {
const scoinType = scallopUtils.parseSCoinType(t);

expect(scoinType).toBe(address.get(`scoin.coins.${t}.coinType`));
});
});

it('Should parse to coin name from coin type', () => {
const coinTypes = SUPPORT_POOLS.map((t) => scallopUtils.parseCoinType(t));
const sCoinTypes = SUPPORT_SCOIN.map((t) => scallopUtils.parseSCoinType(t));

if (ENABLE_LOG) {
console.info('Coin types:', coinTypes);
console.info('Scoin types:', sCoinTypes);
}
coinTypes.forEach((t, idx) => {
const coinName = scallopUtils.parseCoinNameFromType(t);
expect(coinName).toBeDefined();
expect(coinName).toBe(SUPPORT_POOLS[idx]);
});
sCoinTypes.forEach((t, idx) => {
const coinName = scallopUtils.parseCoinNameFromType(t);
expect(coinName).toBeDefined();
expect(coinName).toBe(SUPPORT_SCOIN[idx]);
});
});

it('Should parse to coin name from market name', () => {
Expand Down

0 comments on commit aa0079e

Please sign in to comment.