mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-02-12 15:05:02 -05:00
* upgraded storybook dependencies * upgraded web dependencies * updated timezone selector * upgrade chakra in metamaps * upgraded react-dnd in metamaps * upgraded framer-motion * fixed types in metamaps * upgraded eslint * upgraded lerna, husky and graphql * upgraded node version * removed metamaps package * fixed all eslint issues * ran yarn format to prettier format all files * updated lint-staged & husky scripts * add executable perms to pre-push scripts * updated yarn.lock * fixed eslint and moved chakra icons to ds * fixed emotion errors * removed extra useContext * update yarn.lock * upgraded more packages * removed unnecessary .huskyrc.json * lint fix
30 lines
901 B
TypeScript
30 lines
901 B
TypeScript
import { PlayerRank_Enum } from '../../src/lib/autogen/hasura-sdk';
|
|
import { computeRank, RANKED_CAP } from '../../src/lib/rankHelpers';
|
|
|
|
describe('RANKED_CAP', () => {
|
|
it('should equal 56', () => {
|
|
expect(RANKED_CAP).toBe(56);
|
|
});
|
|
});
|
|
|
|
describe('computeRank', () => {
|
|
it('index 6 should be diamond', () => {
|
|
expect(computeRank(6)).toBe(PlayerRank_Enum.Diamond);
|
|
});
|
|
it('index 7 should be platinum', () => {
|
|
expect(computeRank(7)).toBe(PlayerRank_Enum.Platinum);
|
|
});
|
|
it('index 20 should be gold', () => {
|
|
expect(computeRank(20)).toBe(PlayerRank_Enum.Gold);
|
|
});
|
|
it('index 21 should be silver', () => {
|
|
expect(computeRank(21)).toBe(PlayerRank_Enum.Silver);
|
|
});
|
|
it('index 55 should be bronze', () => {
|
|
expect(computeRank(55)).toBe(PlayerRank_Enum.Bronze);
|
|
});
|
|
it('index 56 should not be ranked', () => {
|
|
expect(computeRank(56)).toBeNull();
|
|
});
|
|
});
|