forked from brandonaaron/jquery-cssHooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgradients.js
More file actions
executable file
·14 lines (12 loc) · 1.37 KB
/
gradients.js
File metadata and controls
executable file
·14 lines (12 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module("gradient");
test("linearGradient", 3, function() {
ok( /linear-gradient/i.test( jQuery("#test2").css("backgroundImage", "linear-gradient(top, blue, red)").css("backgroundImage") ) , "returns correct value using colour names" );
ok( /linear-gradient/i.test( jQuery("#test2").css("backgroundImage", "linear-gradient(top, rgb(0,0,225), rgb(255,0,0))").css("backgroundImage") ) , "returns correct value using rgb values" );
ok( /linear-gradient/i.test( jQuery("#test2").css("backgroundImage", "linear-gradient(top, hsl(240,100%, 50%), hsl(0,100%, 50%))").css("backgroundImage") ) , "returns correct value using hsl values" );
});
test("radialGradient", 3, function() {
jQuery("#test").css("backgroundImage", "radial-gradient(50% 50%, circle, red, blue)");
ok( /radial-gradient/i.test( jQuery("#test2").css("backgroundImage","radial-gradient(50% 50%, circle, grey, blue)").css("backgroundImage") ) , "returns correct value using colour names" );
ok( /radial-gradient/i.test( jQuery("#test2").css("backgroundImage", "radial-gradient(50% 50%, circle, top, rgb(0,0,225), rgb(255,0,0))").css("backgroundImage") ) , "returns correct value using rgb colours" );
ok( /radial-gradient/i.test( jQuery("#test2").css("backgroundImage", "radial-gradient(50% 50%, circle, top, hsl(240,100%, 50%), hsl(0,100%, 50%))").css("backgroundImage") ) , "returns correct value using rgb colours" );
});