File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -627,6 +627,17 @@ describe('config argument', function() {
627
627
}
628
628
}
629
629
630
+ function checkCanvasSize ( canvases , width , height ) {
631
+ var i ;
632
+ for ( i = 0 ; i < canvases . length ; i ++ ) {
633
+ var domRect = canvases [ i ] . getBoundingClientRect ( ) ;
634
+ expect ( domRect . width ) . toBe ( width ) ;
635
+ expect ( domRect . height ) . toBe ( height ) ;
636
+ expect ( + canvases [ i ] . getAttribute ( 'width' ) ) . toBe ( width * 2 ) ;
637
+ expect ( + canvases [ i ] . getAttribute ( 'height' ) ) . toBe ( height * 2 ) ;
638
+ }
639
+ }
640
+
630
641
function testResponsive ( ) {
631
642
checkLayoutSize ( elWidth , elHeight ) ;
632
643
viewport . set ( width / 2 , height / 2 ) ;
@@ -640,7 +651,7 @@ describe('config argument', function() {
640
651
checkElementsSize ( mainSvgs , elWidth / 2 , elHeight / 2 ) ;
641
652
642
653
var canvases = document . getElementsByTagName ( 'canvas' ) ;
643
- checkElementsSize ( canvases , elWidth , elHeight ) ;
654
+ checkCanvasSize ( canvases , elWidth / 2 , elHeight / 2 ) ;
644
655
} )
645
656
. catch ( failTest ) ;
646
657
}
You can’t perform that action at this time.
0 commit comments