Skip to content

Commit b46d170

Browse files
committed
add Hex validation tests
1 parent 2f34193 commit b46d170

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

test/qunit.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,11 +1124,30 @@
11241124
});
11251125
});
11261126

1127+
test("Color Hex validation", function() {
1128+
1129+
clearForm();
1130+
1131+
var links = [
1132+
{val: '#0000FF', isValid: true},
1133+
{val: '#00F', isValid: true},
1134+
{val: '123', isValid: false},
1135+
{val: '112233', isValid: false},
1136+
{val: '#4567', isValid: false},
1137+
{val: input('transparent', {'allow-transparent': 'true'}), isValid: true},
1138+
{val: 'transparent', isValid: false}
1139+
];
1140+
1141+
$.each(links, function(i, obj) {
1142+
runTest(obj, 'hex');
1143+
});
1144+
});
1145+
11271146
// TODO: Write more tests...
11281147
}
11291148

11301149
$.validate({
1131-
modules : 'security, location, sweden, file, date, sanitize, uk, poland',
1150+
modules : 'security, location, sweden, file, date, sanitize, uk, poland, color',
11321151
onModulesLoaded: function( $form ) {
11331152
if( window.console && window.console.log )
11341153
console.log('About to run all tests');

0 commit comments

Comments
 (0)