Skip to content

Commit 8dab0cf

Browse files
authored
Merge pull request #6919 from BitGo/COIN-5570
test: Token naming convention for polygon
2 parents 5ec3ddd + 612922b commit 8dab0cf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

modules/statics/test/unit/tokenNamingConvention.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { cosmosTokens } from '../../src/coins/cosmosTokens';
33
import { avaxTokens } from '../../src/coins/avaxTokens';
44
import { bscTokens } from '../../src/coins/bscTokens';
55
import { nep141Tokens } from '../../src/coins/nep141Tokens';
6+
import { polygonTokens } from '../../src/coins/polygonTokens';
67
import { NetworkType } from '../../src/networks';
78

89
describe('Token Naming Convention Tests', function () {
9-
const allTokens = [...erc20Coins, ...cosmosTokens, ...avaxTokens, ...bscTokens, ...nep141Tokens];
10+
const allTokens = [...erc20Coins, ...cosmosTokens, ...avaxTokens, ...bscTokens, ...nep141Tokens, ...polygonTokens];
1011

1112
// Helper function to filter tokens by network type
1213
function getTokensByNetworkType(networkType: NetworkType) {
@@ -209,7 +210,8 @@ describe('Token Naming Convention Tests', function () {
209210
// Special cases for tokens which don't follow the pattern
210211
if (
211212
(testnetVersion.networkPrefix === 'ofct' && mainnetVersion.networkPrefix === 'ofc') ||
212-
(testnetVersion.networkPrefix === 'thash' && mainnetVersion.networkPrefix === 'hash')
213+
(testnetVersion.networkPrefix === 'thash' && mainnetVersion.networkPrefix === 'hash') ||
214+
(testnetVersion.networkPrefix === 'tpolygon' && mainnetVersion.networkPrefix === 'polygon')
213215
) {
214216
return; // Skip the check for these special cases
215217
}
@@ -319,8 +321,15 @@ describe('Token Naming Convention Tests', function () {
319321
});
320322

321323
it('should ensure all token names are lowercase', function () {
324+
// List of tokens that are exceptions to the lowercase rule
325+
const lowercaseExceptions: string[] = ['tpolygon:BitGoTest'];
326+
322327
allTokens.forEach((token) => {
323328
const tokenName = token.name;
329+
// Skip known exceptions
330+
if (lowercaseExceptions.includes(tokenName)) {
331+
return;
332+
}
324333
tokenName.should.equal(tokenName.toLowerCase(), `Token "${tokenName}" should be lowercase`);
325334
});
326335
});

0 commit comments

Comments
 (0)