Skip to content

Commit e48cb05

Browse files
authored
add test cases for converting transparent, inherit and currentcolor (#102)
1 parent 45d7f39 commit e48cb05

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,37 @@ test('invalid colors return a default object', () => {
6666
})
6767
})
6868

69+
test('converts `transparent` to 0% opacity black', () => {
70+
const transparent = convert('transparent')
71+
assert.equal(transparent, {
72+
hue: 0,
73+
saturation: 0,
74+
lightness: 0,
75+
alpha: 0,
76+
authored: 'transparent'
77+
})
78+
})
79+
80+
test('converts `inherit` to 0% opacity black', () => {
81+
assert.equal(convert('inherit'), {
82+
hue: 0,
83+
saturation: 0,
84+
lightness: 0,
85+
alpha: 0,
86+
authored: 'inherit'
87+
})
88+
})
89+
90+
test('converts `currrentcolor` to 0% opacity black', () => {
91+
assert.equal(convert('currentcolor'), {
92+
hue: 0,
93+
saturation: 0,
94+
lightness: 0,
95+
alpha: 0,
96+
authored: 'currentcolor'
97+
})
98+
})
99+
69100
test('comparing two colors', () => {
70101
const a = convert('red')
71102
const b = convert('blue')

0 commit comments

Comments
 (0)