]> git.proxmox.com Git - mirror_xterm.js.git/blobdiff - test/viewport-test.js
refresh the height of the viewport when the line-height changed
[mirror_xterm.js.git] / test / viewport-test.js
index 186ef98245443fabda022647413e7eaa548fda77..7e99c4301fb67eb7d9d2955e92ad5d4c6547bb52 100644 (file)
@@ -75,6 +75,18 @@ describe('Viewport', function () {
       assert.equal(viewportElement.style.lineHeight, '1px');
       assert.equal(terminal.rowContainer.style.lineHeight, '1px');
     });
+    it('should set the height of the viewport when the line-height changed', function () {
+      terminal.lines.push('');
+      terminal.lines.push('');
+      terminal.rows = 1;
+      viewport.refresh();
+      assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px');
+      charMeasureElement.getBoundingClientRect = function () {
+        return { width: null, height: 20 };
+      };
+      viewport.refresh();
+      assert.equal(viewportElement.style.height, 20 + 'px');
+    });
   });
 
   describe('syncScrollArea', function () {