@@ -464,6 +464,7 @@ it('transforms box-shadow into shadow- properties', () => runTest([
464
464
shadowOffset : { width : 10 , height : 20 } ,
465
465
shadowRadius : 30 ,
466
466
shadowColor : 'red' ,
467
+ shadowOpacity : 1 ,
467
468
} ) ) ;
468
469
469
470
it ( 'transforms box-shadow without blur-radius' , ( ) => runTest ( [
@@ -472,14 +473,16 @@ it('transforms box-shadow without blur-radius', () => runTest([
472
473
shadowOffset : { width : 10 , height : 20 } ,
473
474
shadowRadius : 0 ,
474
475
shadowColor : 'red' ,
476
+ shadowOpacity : 1 ,
475
477
} ) ) ;
476
478
477
479
it ( 'transforms box-shadow without color' , ( ) => runTest ( [
478
- [ 'box-shadow' , '10px 20px red ' ] ,
480
+ [ 'box-shadow' , '10px 20px 30px ' ] ,
479
481
] , {
480
482
shadowOffset : { width : 10 , height : 20 } ,
481
- shadowRadius : 0 ,
482
- shadowColor : 'red' ,
483
+ shadowRadius : 30 ,
484
+ shadowColor : 'black' ,
485
+ shadowOpacity : 1 ,
483
486
} ) ) ;
484
487
485
488
it ( 'transforms box-shadow without blur-radius, color' , ( ) => runTest ( [
@@ -488,8 +491,50 @@ it('transforms box-shadow without blur-radius, color', () => runTest([
488
491
shadowOffset : { width : 10 , height : 20 } ,
489
492
shadowRadius : 0 ,
490
493
shadowColor : 'black' ,
494
+ shadowOpacity : 1 ,
495
+ } ) ) ;
496
+
497
+ it ( 'transforms box-shadow with rgb color' , ( ) => runTest ( [
498
+ [ 'box-shadow' , '10px 20px rgb(100, 100, 100)' ] ,
499
+ ] , {
500
+ shadowOffset : { width : 10 , height : 20 } ,
501
+ shadowRadius : 0 ,
502
+ shadowColor : 'rgb(100, 100, 100)' ,
503
+ shadowOpacity : 1 ,
491
504
} ) ) ;
492
505
506
+ it ( 'transforms box-shadow with rgba color' , ( ) => runTest ( [
507
+ [ 'box-shadow' , '10px 20px rgba(100, 100, 100, 0.5)' ] ,
508
+ ] , {
509
+ shadowOffset : { width : 10 , height : 20 } ,
510
+ shadowRadius : 0 ,
511
+ shadowColor : 'rgba(100, 100, 100, 0.5)' ,
512
+ shadowOpacity : 1 ,
513
+ } ) ) ;
514
+
515
+ it ( 'transforms box-shadow with hsl color' , ( ) => runTest ( [
516
+ [ 'box-shadow' , '10px 20px hsl(120, 100%, 50%)' ] ,
517
+ ] , {
518
+ shadowOffset : { width : 10 , height : 20 } ,
519
+ shadowRadius : 0 ,
520
+ shadowColor : 'hsl(120, 100%, 50%)' ,
521
+ shadowOpacity : 1 ,
522
+ } ) ) ;
523
+
524
+ it ( 'transforms box-shadow with hsla color' , ( ) => runTest ( [
525
+ [ 'box-shadow' , '10px 20px hsla(120, 100%, 50%, 0.7)' ] ,
526
+ ] , {
527
+ shadowOffset : { width : 10 , height : 20 } ,
528
+ shadowRadius : 0 ,
529
+ shadowColor : 'hsla(120, 100%, 50%, 0.7)' ,
530
+ shadowOpacity : 1 ,
531
+ } ) ) ;
532
+
533
+ it ( 'transforms box-shadow and throws if multiple colors are used' , ( ) => {
534
+ expect ( ( ) => transformCss ( [ [ 'box-shadow' , '0 0 0 red yellow green blue' ] ] ) )
535
+ . toThrow ( 'Failed to parse declaration "boxShadow: 0 0 0 red yellow green blue"' ) ;
536
+ } ) ;
537
+
493
538
it ( 'transforms box-shadow enforces offset to be present' , ( ) => {
494
539
expect ( ( ) => transformCss ( [ [ 'box-shadow' , 'red' ] ] ) )
495
540
. toThrow ( 'Failed to parse declaration "boxShadow: red"' ) ;
0 commit comments