@@ -4366,6 +4366,7 @@ describe('Validators', () => {
4366
4366
'rgb(4,4,5%)' ,
4367
4367
'rgba(5%,5%,5%)' ,
4368
4368
'r g b( 0, 251, 222 )' ,
4369
+ 'rgba(255, 255, 255 ,0.2)' ,
4369
4370
'r g ba( 0, 251, 222 )' ,
4370
4371
] ,
4371
4372
} ) ;
@@ -4411,10 +4412,37 @@ describe('Validators', () => {
4411
4412
] ,
4412
4413
} ) ;
4413
4414
4414
- // test where strict is false as part of options object
4415
+ // test where percent value and strict are false as part of options object
4415
4416
test ( {
4416
4417
validator : 'isRgbColor' ,
4417
- args : [ { includePercentValues : true , strict : false } ] ,
4418
+ args : [ { includePercentValues : false , strict : false } ] ,
4419
+ valid : [
4420
+ 'rgb(5,5,5)' ,
4421
+ 'rgba(5,5,5,.3)' ,
4422
+ 'rgba(255,255,255,0.2)' ,
4423
+ 'rgba(255, 255, 255 ,0.2)' ,
4424
+ ] ,
4425
+ invalid : [
4426
+ 'rgb(4,4,5%)' ,
4427
+ 'rgba(5%,5%,5%)' ,
4428
+ 'rgba(5% ,5%, 5%)' ,
4429
+ 'r g b( 0, 251, 222 )' ,
4430
+ 'r g ba( 0, 251, 222 )' ,
4431
+ 'rgb(0,0,)' ,
4432
+ 'rgb()' ,
4433
+ 'rgb(4,4,5%)' ,
4434
+ 'rgb(5%,5%,5%)' ,
4435
+ 'rgba(3,3,3%,.3)' ,
4436
+ 'rgb(101%, 101%, 101%)' ,
4437
+ 'rgba(3%,3%,101%,0.3)' ,
4438
+ ] ,
4439
+
4440
+ } ) ;
4441
+
4442
+ // test where strict is true as part of options object
4443
+ test ( {
4444
+ validator : 'isRgbColor' ,
4445
+ args : [ { includePercentValues : true , strict : true } ] ,
4418
4446
valid : [
4419
4447
'rgb(5,5,5)' ,
4420
4448
'rgba(5,5,5,.3)' ,
@@ -4426,12 +4454,13 @@ describe('Validators', () => {
4426
4454
'rgba(255,255,255,0.1)' ,
4427
4455
'rgb(5%,5%,5%)' ,
4428
4456
'rgba(5%,5%,5%,.3)' ,
4457
+
4458
+ ] ,
4459
+ invalid : [
4429
4460
'rgb( 255,255 ,255)' ,
4430
4461
'rgba(255, 255, 255, 0.5)' ,
4431
4462
'rgb(5%, 5%, 5%)' ,
4432
4463
'rgba(255, 255, 255, 0.5)' ,
4433
- ] ,
4434
- invalid : [
4435
4464
'rgb(4,4,5%)' ,
4436
4465
'rgba(5%,5%,5%)' ,
4437
4466
'r g b( 0, 251, 222 )' ,
0 commit comments