Skip to content

Commit cf7301e

Browse files
committed
add Rgb validation tests
1 parent 738a84f commit cf7301e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/qunit.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,31 @@
11431143
});
11441144
});
11451145

1146+
test("Color Rgb validation", function() {
1147+
1148+
clearForm();
1149+
1150+
var links = [
1151+
{val: 'rgb(255,255,255)', isValid: true},
1152+
{val: 'rgb( 255 , 255 , 255 )', isValid: true},
1153+
{val: 'rgb( 255, 255, 255 )', isValid: true},
1154+
{val: 'rgb(255,255,255)', isValid: true},
1155+
1156+
1157+
{val: 'rgb(-10,255,255)', isValid: false},
1158+
{val: '255255255', isValid: false},
1159+
{val: 'rgb(255,255,256)', isValid: false},
1160+
1161+
1162+
{val: input('transparent', {'allow-transparent': 'true'}), isValid: true},
1163+
{val: 'transparent', isValid: false}
1164+
];
1165+
1166+
$.each(links, function(i, obj) {
1167+
runTest(obj, 'rgb');
1168+
});
1169+
});
1170+
11461171
// TODO: Write more tests...
11471172
}
11481173

0 commit comments

Comments
 (0)