None colour from API (#1063)

This commit is contained in:
Alex Christoffer Rasmussen
2024-06-12 21:31:08 +02:00
committed by GitHub
parent b1838a5e9a
commit 9e63261b35
2 changed files with 13 additions and 1 deletions
@@ -18,6 +18,13 @@ describe('parses a colour string that is', () => {
it('not a string', () => {
expect(() => coerceColour(5)).toThrowError(Error('Invalid colour value received'));
});
it('undefinde and null are not valid', () => {
expect(() => coerceColour(null)).toThrowError(Error('Invalid colour value received'));
expect(() => coerceColour(undefined)).toThrowError(Error('Invalid colour value received'));
});
it('empty string is allowed', () => {
expect(coerceColour('')).toBe('');
});
});
describe('match a string to an enum that is', () => {