Skip to content

Commit ca30f10

Browse files
committed
test(theme): handle mixed digit hex colors and mixed hash usage
1 parent dab8950 commit ca30f10

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/utils/test/theme.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,19 @@ describe('mix()', () => {
750750
it('should handle 3-digit hex colors', () => {
751751
expect(mix('#000', '#fff', '50%')).toBe('#808080');
752752
expect(mix('#f00', '#0f0', '50%')).toBe('#808000');
753+
754+
// 3-digit + 6-digit
755+
expect(mix('#000', '#ffffff', '50%')).toBe('#808080');
756+
expect(mix('#000000', '#fff', '50%')).toBe('#808080');
753757
});
754758

755759
it('should handle hex colors without hash prefix', () => {
756760
expect(mix('000000', 'ffffff', '50%')).toBe('#808080');
757761
expect(mix('f00', '0f0', '50%')).toBe('#808000');
762+
763+
// With and without hash prefix
764+
expect(mix('#000000', 'ffffff', '50%')).toBe('#808080');
765+
expect(mix('f00', '#0f0', '50%')).toBe('#808000');
758766
});
759767

760768
it('should handle fractional percentages', () => {

0 commit comments

Comments
 (0)