aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/methods/zoomTo.js
diff options
context:
space:
mode:
Diffstat (limited to 'library/cropperjs/test/methods/zoomTo.js')
-rw-r--r--library/cropperjs/test/methods/zoomTo.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/library/cropperjs/test/methods/zoomTo.js b/library/cropperjs/test/methods/zoomTo.js
new file mode 100644
index 000000000..dd9e81760
--- /dev/null
+++ b/library/cropperjs/test/methods/zoomTo.js
@@ -0,0 +1,21 @@
+QUnit.test('methods#zoomTo', function (assert) {
+ var done = assert.async();
+ var util = window.Util;
+ var image = util.createImage();
+
+ assert.expect(3);
+
+ return new Cropper(image, {
+ ready: function () {
+ var cropper = this.cropper;
+ var imageData = cropper.zoomTo(1).getImageData();
+ var canvasData = cropper.getCanvasData();
+
+ assert.strictEqual(imageData.width, imageData.naturalWidth);
+ assert.strictEqual(canvasData.width, canvasData.naturalWidth);
+ assert.strictEqual(canvasData.naturalWidth, imageData.naturalWidth);
+
+ done();
+ }
+ });
+});