@@ -518,87 +518,6 @@ describe("parseTime", function () {
518518 } ) ;
519519} ) ;
520520
521- describe ( "getCSSValue" , function ( ) {
522- beforeEach ( function ( ) {
523- const el1 = document . createElement ( "div" ) ;
524- const el2 = document . createElement ( "div" ) ;
525-
526- el1 . setAttribute ( "id" , "el1" ) ;
527- el2 . setAttribute ( "id" , "el2" ) ;
528- el1 . appendChild ( el2 ) ;
529-
530- // Need to attach element to body to make CSS calculation work.
531- document . body . appendChild ( el1 ) ;
532-
533- el1 . style [ "font-size" ] = "12px" ;
534- el1 . style [ "margin-top" ] = "1em" ;
535- el1 . style . border = "1em solid black" ;
536- el1 . style . position = "relative" ;
537- el2 . style [ "margin-bottom" ] = "2em" ;
538- } ) ;
539-
540- afterEach ( function ( ) {
541- document . querySelector ( "#el1" ) . remove ( ) ;
542- } ) ;
543-
544- it ( "Return values for CSS properties of a HTML node" , function ( ) {
545- const el1 = document . querySelector ( "#el1" ) ;
546- expect ( utils . getCSSValue ( el1 , "font-size" ) ) . toBe ( "12px" ) ;
547- expect ( utils . getCSSValue ( el1 , "font-size" , true ) ) . toBe ( 12 ) ;
548- expect ( utils . getCSSValue ( el1 , "position" ) ) . toBe ( "relative" ) ;
549- } ) ;
550-
551- it ( "Return string, int or float, as requested." , function ( ) {
552- const el1 = document . querySelector ( "#el1" ) ;
553- expect ( utils . getCSSValue ( el1 , "font-size" ) ) . toBe ( "12px" ) ;
554- expect ( utils . getCSSValue ( el1 , "font-size" , true ) ) . toBe ( 12 ) ;
555- expect ( utils . getCSSValue ( el1 , "font-size" , true , true ) ) . toBe ( 12.0 ) ;
556- expect ( utils . getCSSValue ( el1 , "font-size" , null , true ) ) . toBe ( 12.0 ) ;
557- } ) ;
558-
559- it ( "Returns 0 for when requesting a numerical value which doesn't exist." , function ( ) {
560- const el = document . createElement ( "div" ) ;
561- expect ( utils . getCSSValue ( el , "hallo" , true ) ) . toBe ( 0 ) ;
562- expect ( utils . getCSSValue ( el , "hallo" , true , true ) ) . toBe ( 0.0 ) ;
563- expect ( utils . getCSSValue ( el , "hallo" , null , true ) ) . toBe ( 0.0 ) ;
564- } ) ;
565-
566- it . skip ( "Return inherited values for CSS properties" , function ( ) {
567- // Missing JSDOM support for style inheritance yet. See:
568- // https://github.com/jsdom/jsdom/issues/2160
569- // https://github.com/jsdom/jsdom/pull/2668
570- // https://github.com/jsdom/jsdom/blob/master/Changelog.md
571-
572- const el2 = document . querySelector ( "#el2" ) ;
573- expect ( utils . getCSSValue ( el2 , "font-size" ) ) . toBe ( "12px" ) ;
574- } ) ;
575-
576- it . skip ( "Shorthand properties are split up" , function ( ) {
577- // Missing JSDOM support for property split yet.
578-
579- const el1 = document . querySelector ( "#el1" ) ;
580- // ``em`` are parsed to pixel values.
581- // shorthand property sets like ``border`` are split up into their
582- // individual properties, like ``border-top-width``.
583- expect ( utils . getCSSValue ( el1 , "border-top-width" ) ) . toBe ( "12px" ) ;
584- expect ( utils . getCSSValue ( el1 , "border-top-style" ) ) . toBe ( "solid" ) ;
585- expect ( utils . getCSSValue ( el1 , "border-top-color" ) ) . toBe ( "rgb(0, 0, 0)" ) ;
586- } ) ;
587-
588- it . skip ( "Values with relative units are converted to pixels" , function ( ) {
589- // Missing JSDOM support for unit conversion yet.
590-
591- const el1 = document . querySelector ( "#el1" ) ;
592- const el2 = document . querySelector ( "#el2" ) ;
593- // Relative length-type values are converted to absolute pixels.
594- expect ( utils . getCSSValue ( el1 , "margin-top" ) ) . toBe ( "12px" ) ;
595- expect ( utils . getCSSValue ( el1 , "margin-top" , true ) ) . toBe ( 12 ) ;
596- expect ( utils . getCSSValue ( el2 , "margin-top" , true ) ) . toBe ( 0 ) ;
597- expect ( utils . getCSSValue ( el2 , "margin-bottom" ) ) . toBe ( "24px" ) ;
598- expect ( utils . getCSSValue ( el2 , "margin-bottom" , true ) ) . toBe ( 24 ) ;
599- } ) ;
600- } ) ;
601-
602521describe ( "get_bounds" , function ( ) {
603522 it ( "returns the bounds values as integer numbers instead of double/float values." , ( ) => {
604523 const el = document . createElement ( "div" ) ;
0 commit comments