aboutsummaryrefslogblamecommitdiffstats
path: root/library/cropperjs/test/options/minCanvasHeight.js
blob: c9745a9b19a27c4226f7393f9e4bf739898b3e82 (plain) (tree)






















                                                                         
QUnit.test('options#minCanvasHeight', function (assert) {
  var done = assert.async();
  var util = window.Util;
  var image = util.createImage();
  var minCanvasHeight = 270;

  assert.expect(1);

  return new Cropper(image, {
    minCanvasHeight: minCanvasHeight,

    ready: function () {
      var cropper = this.cropper;
      var canvasData = cropper.setCanvasData({
            height: 180
          }).getCanvasData();

      assert.strictEqual(Math.round(canvasData.height), minCanvasHeight);

      done();
    }
  });
});