Skip to content

Commit

Permalink
add Rgb validation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dszymczuk committed Aug 27, 2017
1 parent 738a84f commit cf7301e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/qunit.html
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,31 @@
});
});

test("Color Rgb validation", function() {

clearForm();

var links = [
{val: 'rgb(255,255,255)', isValid: true},
{val: 'rgb( 255 , 255 , 255 )', isValid: true},
{val: 'rgb( 255, 255, 255 )', isValid: true},
{val: 'rgb(255,255,255)', isValid: true},


{val: 'rgb(-10,255,255)', isValid: false},
{val: '255255255', isValid: false},
{val: 'rgb(255,255,256)', isValid: false},


{val: input('transparent', {'allow-transparent': 'true'}), isValid: true},
{val: 'transparent', isValid: false}
];

$.each(links, function(i, obj) {
runTest(obj, 'rgb');
});
});

// TODO: Write more tests...
}

Expand Down

0 comments on commit cf7301e

Please sign in to comment.