Skip to content

Commit d666f09

Browse files
committed
Fix responsive tests
1 parent 992b50e commit d666f09

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/jasmine/tests/config_test.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,17 @@ describe('config argument', function() {
627627
}
628628
}
629629

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+
630641
function testResponsive() {
631642
checkLayoutSize(elWidth, elHeight);
632643
viewport.set(width / 2, height / 2);
@@ -640,7 +651,7 @@ describe('config argument', function() {
640651
checkElementsSize(mainSvgs, elWidth / 2, elHeight / 2);
641652

642653
var canvases = document.getElementsByTagName('canvas');
643-
checkElementsSize(canvases, elWidth, elHeight);
654+
checkCanvasSize(canvases, elWidth / 2, elHeight / 2);
644655
})
645656
.catch(failTest);
646657
}

0 commit comments

Comments
 (0)