chore: make test names consistent (#1183)
This commit is contained in:
parent
fcd9a0321b
commit
620d33fea5
@ -1,11 +1,11 @@
|
|||||||
import { BigNumber } from './bignumber';
|
import { BigNumber } from './bignumber';
|
||||||
import { addDecimal, removeDecimal } from './decimals';
|
import { addDecimal, removeDecimal } from './decimals';
|
||||||
|
|
||||||
test('Do not pad numbers with 0s when the number length is less than the specified DPs', () => {
|
it('Do not pad numbers with 0s when the number length is less than the specified DPs', () => {
|
||||||
expect(addDecimal(new BigNumber(10000), 10)).toEqual('0.000001');
|
expect(addDecimal(new BigNumber(10000), 10)).toEqual('0.000001');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Handles large numbers correctly', () => {
|
it('Handles large numbers correctly', () => {
|
||||||
const claimCode = new BigNumber('20000000000000000000000000');
|
const claimCode = new BigNumber('20000000000000000000000000');
|
||||||
const decimals = 18;
|
const decimals = 18;
|
||||||
|
|
||||||
|
@ -4,26 +4,26 @@ afterEach(() => {
|
|||||||
document.cookie = '';
|
document.cookie = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Returns false on no cookie', () => {
|
it('Returns false on no cookie', () => {
|
||||||
expect(isRestricted()).toEqual(false);
|
expect(isRestricted()).toEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Returns false on no restricted cookie', () => {
|
it('Returns false on no restricted cookie', () => {
|
||||||
document.cookie = 'one=a;two=b';
|
document.cookie = 'one=a;two=b';
|
||||||
expect(isRestricted()).toEqual(false);
|
expect(isRestricted()).toEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Returns true if a cookie called restricted is set but false', () => {
|
it('Returns true if a cookie called restricted is set but false', () => {
|
||||||
document.cookie = 'restricted=false';
|
document.cookie = 'restricted=false';
|
||||||
expect(isRestricted()).toEqual(false);
|
expect(isRestricted()).toEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Returns true if a cookie called restricted is set and true', () => {
|
it('Returns true if a cookie called restricted is set and true', () => {
|
||||||
document.cookie = 'restricted=true';
|
document.cookie = 'restricted=true';
|
||||||
expect(isRestricted()).toEqual(true);
|
expect(isRestricted()).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Handle weird data', () => {
|
it('Handle weird data', () => {
|
||||||
document.cookie = ';🍪;;;;;🍪=🍪;;;;;;;;;🍪';
|
document.cookie = ';🍪;;;;;🍪=🍪;;;;;;;;;🍪';
|
||||||
expect(isRestricted()).toEqual(true);
|
expect(isRestricted()).toEqual(true);
|
||||||
});
|
});
|
||||||
|
@ -2,7 +2,7 @@ import { BigNumber } from '../../../lib/bignumber';
|
|||||||
import { sumCirculatingTokens } from './token-details-circulating';
|
import { sumCirculatingTokens } from './token-details-circulating';
|
||||||
import type { Tranche } from '@vegaprotocol/smart-contracts';
|
import type { Tranche } from '@vegaprotocol/smart-contracts';
|
||||||
|
|
||||||
test('It sums some easy tranches correctly', () => {
|
it('It sums some easy tranches correctly', () => {
|
||||||
const tranches: Partial<Tranche>[] = [
|
const tranches: Partial<Tranche>[] = [
|
||||||
{ total_added: new BigNumber('100'), locked_amount: new BigNumber(0) },
|
{ total_added: new BigNumber('100'), locked_amount: new BigNumber(0) },
|
||||||
{ total_added: new BigNumber('100'), locked_amount: new BigNumber(0) },
|
{ total_added: new BigNumber('100'), locked_amount: new BigNumber(0) },
|
||||||
@ -13,7 +13,7 @@ test('It sums some easy tranches correctly', () => {
|
|||||||
expect(result.toString()).toEqual('300');
|
expect(result.toString()).toEqual('300');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('It sums some longer tranches correctly', () => {
|
it('It sums some longer tranches correctly', () => {
|
||||||
const tranches: Partial<Tranche>[] = [
|
const tranches: Partial<Tranche>[] = [
|
||||||
{
|
{
|
||||||
total_added: new BigNumber('10000000000'),
|
total_added: new BigNumber('10000000000'),
|
||||||
@ -27,7 +27,7 @@ test('It sums some longer tranches correctly', () => {
|
|||||||
expect(result.toString()).toEqual('10000000000');
|
expect(result.toString()).toEqual('10000000000');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Handles null tranche array', () => {
|
it('Handles null tranche array', () => {
|
||||||
const tranches = null;
|
const tranches = null;
|
||||||
|
|
||||||
const result = sumCirculatingTokens(tranches as unknown as Tranche[]);
|
const result = sumCirculatingTokens(tranches as unknown as Tranche[]);
|
||||||
|
Loading…
Reference in New Issue
Block a user