Skip to content

Commit

Permalink
chore: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gka committed Aug 17, 2024
1 parent e67d7da commit 89c416a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/color.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,18 @@ describe('Testing Color', () => {
});
});
});

it('create lch color from object', () => {
expect(new Color({ l: 80, c: 25, h: 200 }).hex()).toBe('#85d4d5');
expect(chroma({ l: 80, c: 25, h: 200 }).hex()).toBe('#85d4d5');
expect(chroma.lch(80, 25, 200).hex()).toBe('#85d4d5');
expect(chroma(80, 25, 200, 'lch').hex()).toBe('#85d4d5');
});

it('create hcl color from object', () => {
expect(new Color({ h: 200, c: 25, l: 80 }).hex()).toBe('#85d4d5');
expect(chroma({ h: 200, c: 25, l: 80 }).hex()).toBe('#85d4d5');
expect(chroma.hcl(200, 25, 80).hex()).toBe('#85d4d5');
expect(chroma(200, 25, 80, 'hcl').hex()).toBe('#85d4d5');
});
});

0 comments on commit 89c416a

Please sign in to comment.