|
|
@@ -3536,7 +3536,7 @@ describe('hslColor', function() {
|
|
|
beforeEach(function() {
|
|
|
var html = [
|
|
|
'<div class="container">',
|
|
|
- '<form class="form-horizontal" id="rbgColorForm">',
|
|
|
+ '<form class="form-horizontal" id="hslColorForm">',
|
|
|
'<div class="form-group">',
|
|
|
'<input type="text" name="hsl" data-bv-hslcolor />',
|
|
|
'</div>',
|
|
|
@@ -3545,14 +3545,14 @@ describe('hslColor', function() {
|
|
|
].join('\n');
|
|
|
|
|
|
$(html).appendTo('body');
|
|
|
- $('#rbgColorForm').bootstrapValidator();
|
|
|
+ $('#hslColorForm').bootstrapValidator();
|
|
|
|
|
|
- this.bv = $('#rbgColorForm').data('bootstrapValidator');
|
|
|
+ this.bv = $('#hslColorForm').data('bootstrapValidator');
|
|
|
this.$hslColor = this.bv.getFieldElements('hsl');
|
|
|
});
|
|
|
|
|
|
afterEach(function() {
|
|
|
- $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
|
|
|
+ $('#hslColorForm').bootstrapValidator('destroy').parent().remove();
|
|
|
});
|
|
|
|
|
|
it('accept hsl()', function() {
|
|
|
@@ -3644,7 +3644,6 @@ describe('hslColor', function() {
|
|
|
this.bv.validate();
|
|
|
expect(this.bv.isValidField('hsl')).toEqual(false);
|
|
|
});
|
|
|
-
|
|
|
});
|
|
|
|
|
|
describe('iban', function() {
|
|
|
@@ -5963,107 +5962,107 @@ describe('rgbColor', function() {
|
|
|
beforeEach(function() {
|
|
|
var html = [
|
|
|
'<div class="container">',
|
|
|
- '<form class="form-horizontal" id="rbgColorForm">',
|
|
|
+ '<form class="form-horizontal" id="rgbColorForm">',
|
|
|
'<div class="form-group">',
|
|
|
- '<input type="text" name="rc" data-bv-rgbcolor />',
|
|
|
+ '<input type="text" name="rgb" data-bv-rgbcolor />',
|
|
|
'</div>',
|
|
|
'</form>',
|
|
|
'</div>'
|
|
|
].join('\n');
|
|
|
|
|
|
$(html).appendTo('body');
|
|
|
- $('#rbgColorForm').bootstrapValidator();
|
|
|
+ $('#rgbColorForm').bootstrapValidator();
|
|
|
|
|
|
- this.bv = $('#rbgColorForm').data('bootstrapValidator');
|
|
|
- this.$rgbColor = this.bv.getFieldElements('rc');
|
|
|
+ this.bv = $('#rgbColorForm').data('bootstrapValidator');
|
|
|
+ this.$rgbColor = this.bv.getFieldElements('rgb');
|
|
|
});
|
|
|
|
|
|
afterEach(function() {
|
|
|
- $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
|
|
|
+ $('#rgbColorForm').bootstrapValidator('destroy').parent().remove();
|
|
|
});
|
|
|
|
|
|
it('accept rgb()', function() {
|
|
|
this.$rgbColor.val('rgb(255,255,255)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toBeTruthy();
|
|
|
+ expect(this.bv.isValidField('rgb')).toBeTruthy();
|
|
|
});
|
|
|
|
|
|
it('accept spaces around numeric values', function() {
|
|
|
this.$rgbColor.val('rgb( 255 , 255 , 255 )');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toBeTruthy();
|
|
|
+ expect(this.bv.isValidField('rgb')).toBeTruthy();
|
|
|
});
|
|
|
|
|
|
it('accept multiple spaces around numeric values', function() {
|
|
|
this.$rgbColor.val('rgb( 255, 255, 255 )');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toBeTruthy();
|
|
|
+ expect(this.bv.isValidField('rgb')).toBeTruthy();
|
|
|
});
|
|
|
|
|
|
it('accept interger values', function() {
|
|
|
this.$rgbColor.val('rgb(255,255,255)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toBeTruthy();
|
|
|
+ expect(this.bv.isValidField('rgb')).toBeTruthy();
|
|
|
});
|
|
|
|
|
|
it('accept percent values', function() {
|
|
|
this.$rgbColor.val('rgb(100%,100%,100%)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toBeTruthy();
|
|
|
+ expect(this.bv.isValidField('rgb')).toBeTruthy();
|
|
|
});
|
|
|
|
|
|
it('reject mixed intergers and percentile input', function() {
|
|
|
this.$rgbColor.val('rgb(255,255,100%)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
it('reject negative integers', function() {
|
|
|
this.$rgbColor.val('rgb(-10,255,255)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
it('reject negative percentages', function() {
|
|
|
this.$rgbColor.val('rgb(-10%,100%,100%)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
it('require rgb()', function() {
|
|
|
this.$rgbColor.val('255,255,255');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
it('reject intergers above 255', function() {
|
|
|
this.$rgbColor.val('rgb(255,255,256)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
it('reject percentages above 100%', function() {
|
|
|
this.$rgbColor.val('rgb(100%,100%,101%)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
it('reject space between rgb and (', function() {
|
|
|
this.$rgbColor.val('rgb (255,255,255)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
it('reject leading space', function() {
|
|
|
this.$rgbColor.val(' rgb(255,255,255)');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
it('reject trailing space', function() {
|
|
|
this.$rgbColor.val('rgb(255,255,255) ');
|
|
|
this.bv.validate();
|
|
|
- expect(this.bv.isValidField('rc')).toEqual(false);
|
|
|
+ expect(this.bv.isValidField('rgb')).toEqual(false);
|
|
|
});
|
|
|
|
|
|
});
|
|
|
@@ -6073,7 +6072,7 @@ describe('rgbaColor', function() {
|
|
|
beforeEach(function() {
|
|
|
var html = [
|
|
|
'<div class="container">',
|
|
|
- '<form class="form-horizontal" id="rbgColorForm">',
|
|
|
+ '<form class="form-horizontal" id="rgbaColorForm">',
|
|
|
'<div class="form-group">',
|
|
|
'<input type="text" name="rgba" data-bv-rgbacolor />',
|
|
|
'</div>',
|
|
|
@@ -6082,14 +6081,14 @@ describe('rgbaColor', function() {
|
|
|
].join('\n');
|
|
|
|
|
|
$(html).appendTo('body');
|
|
|
- $('#rbgColorForm').bootstrapValidator();
|
|
|
+ $('#rgbaColorForm').bootstrapValidator();
|
|
|
|
|
|
- this.bv = $('#rbgColorForm').data('bootstrapValidator');
|
|
|
+ this.bv = $('#rgbaColorForm').data('bootstrapValidator');
|
|
|
this.$rgbaColor = this.bv.getFieldElements('rgba');
|
|
|
});
|
|
|
|
|
|
afterEach(function() {
|
|
|
- $('#rbgColorForm').bootstrapValidator('destroy').parent().remove();
|
|
|
+ $('#rgbaColorForm').bootstrapValidator('destroy').parent().remove();
|
|
|
});
|
|
|
|
|
|
it('accept rgba()', function() {
|