Skip to content

Commit

Permalink
Add CssParser tests for rgba conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 22, 2023
1 parent 65effb0 commit 92679a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test-js/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ function checkCssParser(x) {
x.assert(p2.hasColor, true);
x.assert(p2.elems.length, 1);
x.assert(p2.toRGBAString(), 'linear-gradient(rgba(170, 170, 170, 1), rgba(255, 255, 255, 1))');
x.assert(p2.sameFormatAs(p), 'linear-gradient(rgb(170, 170, 170), rgb(255, 255, 255))');
x.assert(p2.sameFormatAs(p), 'linear-gradient(rgb(170, 170, 170), rgba(255, 255, 255, 1))');

p = new CssParser('rgba(15, 20, 25, 1)');
p2 = new CssParser('rgb(0,0,0)');
x.assert(p2.sameFormatAs(p), 'rgba(0, 0, 0, 1)');
}

function checkTuple(x) {
Expand Down

0 comments on commit 92679a5

Please sign in to comment.