Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/utils/__tests__/validation.test.js
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | describe('Validation utils', () => { | ||||
}); | }); | ||||
it(`Recognizes a token stats object with missing required keys as invalid`, () => { | it(`Recognizes a token stats object with missing required keys as invalid`, () => { | ||||
expect(isValidTokenStats(noCovidStatsInvalid)).toBe(false); | expect(isValidTokenStats(noCovidStatsInvalid)).toBe(false); | ||||
}); | }); | ||||
it(`Recognizes a valid cashtab settings object`, () => { | it(`Recognizes a valid cashtab settings object`, () => { | ||||
expect(isValidCashtabSettings({ fiatCurrency: 'usd' })).toBe(true); | expect(isValidCashtabSettings({ fiatCurrency: 'usd' })).toBe(true); | ||||
}); | }); | ||||
it(`Rejects a cashtab settings object for an unsupported currency`, () => { | it(`Rejects a cashtab settings object for an unsupported currency`, () => { | ||||
expect(isValidCashtabSettings({ fiatCurrency: 'jpy' })).toBe(false); | expect(isValidCashtabSettings({ fiatCurrency: 'xau' })).toBe(false); | ||||
}); | }); | ||||
it(`Rejects a corrupted cashtab settings object for an unsupported currency`, () => { | it(`Rejects a corrupted cashtab settings object for an unsupported currency`, () => { | ||||
expect(isValidCashtabSettings({ fiatCurrencyWrongLabel: 'usd' })).toBe( | expect(isValidCashtabSettings({ fiatCurrencyWrongLabel: 'usd' })).toBe( | ||||
false, | false, | ||||
); | ); | ||||
}); | }); | ||||
}); | }); |