aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/methods
diff options
context:
space:
mode:
Diffstat (limited to 'library/cropperjs/test/methods')
-rw-r--r--library/cropperjs/test/methods/clear.js29
-rw-r--r--library/cropperjs/test/methods/crop.js24
-rw-r--r--library/cropperjs/test/methods/destroy.js22
-rw-r--r--library/cropperjs/test/methods/disable.js60
-rw-r--r--library/cropperjs/test/methods/enable.js23
-rw-r--r--library/cropperjs/test/methods/getCanvasData.js23
-rw-r--r--library/cropperjs/test/methods/getContainerData.js19
-rw-r--r--library/cropperjs/test/methods/getCropBoxData.js21
-rw-r--r--library/cropperjs/test/methods/getCroppedCanvas.js33
-rw-r--r--library/cropperjs/test/methods/getData.js46
-rw-r--r--library/cropperjs/test/methods/getImageData.js31
-rw-r--r--library/cropperjs/test/methods/move.js20
-rw-r--r--library/cropperjs/test/methods/moveTo.js19
-rw-r--r--library/cropperjs/test/methods/replace.js23
-rw-r--r--library/cropperjs/test/methods/reset.js35
-rw-r--r--library/cropperjs/test/methods/rotate.js19
-rw-r--r--library/cropperjs/test/methods/rotateTo.js20
-rw-r--r--library/cropperjs/test/methods/scale.js19
-rw-r--r--library/cropperjs/test/methods/scaleX.js18
-rw-r--r--library/cropperjs/test/methods/scaleY.js18
-rw-r--r--library/cropperjs/test/methods/setAspectRatio.js20
-rw-r--r--library/cropperjs/test/methods/setCanvasData.js34
-rw-r--r--library/cropperjs/test/methods/setCropBoxData.js36
-rw-r--r--library/cropperjs/test/methods/setData.js36
-rw-r--r--library/cropperjs/test/methods/setDragMode.js27
-rw-r--r--library/cropperjs/test/methods/zoom.js20
-rw-r--r--library/cropperjs/test/methods/zoomTo.js21
27 files changed, 0 insertions, 716 deletions
diff --git a/library/cropperjs/test/methods/clear.js b/library/cropperjs/test/methods/clear.js
deleted file mode 100644
index 6510ebad2..000000000
--- a/library/cropperjs/test/methods/clear.js
+++ /dev/null
@@ -1,29 +0,0 @@
-QUnit.test('methods#clear', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- cropper.clear();
- assert.notOk(cropper.cropped);
- assert.deepEqual(cropper.getData(), {
- x: 0,
- y: 0,
- width: 0,
- height: 0,
- rotate: 0,
- scaleX: 1,
- scaleY: 1
- });
- assert.deepEqual(cropper.getCropBoxData(), {});
- assert.ok(util.hasClass(cropper.cropBox, 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/crop.js b/library/cropperjs/test/methods/crop.js
deleted file mode 100644
index e4ae679f1..000000000
--- a/library/cropperjs/test/methods/crop.js
+++ /dev/null
@@ -1,24 +0,0 @@
-QUnit.test('methods#crop', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- autoCrop: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.notOk(cropper.cropped);
- assert.ok(util.hasClass(cropper.cropBox, 'cropper-hidden'));
-
- cropper.crop();
- assert.ok(cropper.cropped);
- assert.notOk(util.hasClass(cropper.cropBox, 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/destroy.js b/library/cropperjs/test/methods/destroy.js
deleted file mode 100644
index cb65e0696..000000000
--- a/library/cropperjs/test/methods/destroy.js
+++ /dev/null
@@ -1,22 +0,0 @@
-QUnit.test('methods#destroy', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- assert.ok(typeof cropper === 'object');
- assert.ok(util.hasClass(image, 'cropper-hidden'));
-
- cropper.destroy();
- assert.ok(typeof this.cropper === 'undefined');
- assert.notOk(util.hasClass(image, 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/disable.js b/library/cropperjs/test/methods/disable.js
deleted file mode 100644
index c87f7aa91..000000000
--- a/library/cropperjs/test/methods/disable.js
+++ /dev/null
@@ -1,60 +0,0 @@
-QUnit.test('methods#disable', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(11);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var options = cropper.options;
- var cropBoxData;
- var canvasData;
- var imageData;
- var action;
-
- cropper.disable();
- assert.ok(cropper.disabled);
- assert.ok(util.hasClass(cropper.cropper, 'cropper-disabled'));
-
- cropBoxData = cropper.getCropBoxData();
- cropper.clear();
- assert.deepEqual(cropper.getCropBoxData(), cropBoxData);
-
- imageData = cropper.getImageData();
- cropper.move(10, 10);
- assert.deepEqual(cropper.getImageData(), imageData);
-
- cropper.zoom(0.5);
- assert.strictEqual(cropper.getImageData().ratio, imageData.ratio);
-
- cropper.rotate(15);
- assert.strictEqual(cropper.getImageData().rotate, imageData.rotate);
-
- cropper.scale(-1);
- assert.strictEqual(cropper.getImageData().scaleX, imageData.scaleX);
-
- canvasData = cropper.getCanvasData();
- cropper.setCanvasData({
- width: canvasData.width - 160
- });
- assert.deepEqual(cropper.getCanvasData(), canvasData);
-
- cropBoxData = cropper.getCropBoxData();
- cropper.setCropBoxData({
- height: cropBoxData.height - 90
- });
- assert.deepEqual(cropper.getCropBoxData(), cropBoxData);
-
- cropper.setAspectRatio(0.618);
- assert.ok(isNaN(options.aspectRatio));
-
- action = cropper.dragBox.dataset.action;
- cropper.setDragMode('none');
- assert.strictEqual(cropper.dragBox.dataset.action, action);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/enable.js b/library/cropperjs/test/methods/enable.js
deleted file mode 100644
index ebd5b9529..000000000
--- a/library/cropperjs/test/methods/enable.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('methods#enable', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- cropper.disable();
- assert.ok(cropper.disabled);
- assert.ok(util.hasClass(cropper.cropper, 'cropper-disabled'));
-
- cropper.enable();
- assert.notOk(cropper.disabled);
- assert.notOk(util.hasClass(cropper.cropper, 'cropper-disabled'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getCanvasData.js b/library/cropperjs/test/methods/getCanvasData.js
deleted file mode 100644
index 60d96af4e..000000000
--- a/library/cropperjs/test/methods/getCanvasData.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('methods#getCanvasData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(6);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
-
- assert.ok(util.isNumber(canvasData.left));
- assert.ok(util.isNumber(canvasData.top));
- assert.ok(util.isNumber(canvasData.width));
- assert.ok(util.isNumber(canvasData.height));
- assert.ok(util.isNumber(canvasData.naturalWidth));
- assert.ok(util.isNumber(canvasData.naturalHeight));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getContainerData.js b/library/cropperjs/test/methods/getContainerData.js
deleted file mode 100644
index 094421ba0..000000000
--- a/library/cropperjs/test/methods/getContainerData.js
+++ /dev/null
@@ -1,19 +0,0 @@
-QUnit.test('methods#getContainerData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var containerData = cropper.getContainerData();
-
- assert.ok(util.isNumber(containerData.width));
- assert.ok(util.isNumber(containerData.height));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getCropBoxData.js b/library/cropperjs/test/methods/getCropBoxData.js
deleted file mode 100644
index 844c7953e..000000000
--- a/library/cropperjs/test/methods/getCropBoxData.js
+++ /dev/null
@@ -1,21 +0,0 @@
-QUnit.test('methods#getCropBoxData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var cropBoxData = cropper.getCropBoxData();
-
- assert.ok(util.isNumber(cropBoxData.left));
- assert.ok(util.isNumber(cropBoxData.top));
- assert.ok(util.isNumber(cropBoxData.width));
- assert.ok(util.isNumber(cropBoxData.height));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getCroppedCanvas.js b/library/cropperjs/test/methods/getCroppedCanvas.js
deleted file mode 100644
index 4117497a5..000000000
--- a/library/cropperjs/test/methods/getCroppedCanvas.js
+++ /dev/null
@@ -1,33 +0,0 @@
-QUnit.test('methods#getCroppedCanvas', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(7);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvas = cropper.getCroppedCanvas({
- width: 160,
- height: 90
- });
- var pixelData;
-
- assert.ok(canvas instanceof HTMLCanvasElement);
- assert.strictEqual(canvas.width, 160);
- assert.strictEqual(canvas.height, 90);
-
- canvas = cropper.rotate(90).getCroppedCanvas({
- fillColor: '#010101'
- });
- pixelData = canvas.getContext('2d').getImageData(0, 0, 1, 1).data;
- assert.strictEqual(pixelData[0], 1, 'red is 1');
- assert.strictEqual(pixelData[1], 1, 'green is 1');
- assert.strictEqual(pixelData[2], 1, 'blue is 1');
- assert.strictEqual(pixelData[3], 255, 'color is opaque');
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getData.js b/library/cropperjs/test/methods/getData.js
deleted file mode 100644
index 9c519eb7f..000000000
--- a/library/cropperjs/test/methods/getData.js
+++ /dev/null
@@ -1,46 +0,0 @@
-QUnit.test('methods#getData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(7);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var data = cropper.getData();
-
- assert.ok(util.isNumber(data.x));
- assert.ok(util.isNumber(data.y));
- assert.ok(util.isNumber(data.width));
- assert.ok(util.isNumber(data.height));
- assert.ok(util.isNumber(data.rotate));
- assert.ok(util.isNumber(data.scaleX));
- assert.ok(util.isNumber(data.scaleY));
-
- done();
- }
- });
-});
-
-QUnit.test('methods#getData: rounded', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var data = cropper.getData(true);
-
- assert.ok(data.x % 1 === 0);
- assert.ok(data.y % 1 === 0);
- assert.ok(data.width % 1 === 0);
- assert.ok(data.height % 1 === 0);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getImageData.js b/library/cropperjs/test/methods/getImageData.js
deleted file mode 100644
index bd6e1941d..000000000
--- a/library/cropperjs/test/methods/getImageData.js
+++ /dev/null
@@ -1,31 +0,0 @@
-QUnit.test('methods#getImageData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(10);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.getImageData();
-
- assert.ok(util.isNumber(imageData.naturalWidth));
- assert.ok(util.isNumber(imageData.naturalHeight));
- assert.ok(util.isNumber(imageData.aspectRatio));
- assert.ok(util.isNumber(imageData.left));
- assert.ok(util.isNumber(imageData.top));
- assert.ok(util.isNumber(imageData.width));
- assert.ok(util.isNumber(imageData.height));
-
- imageData = cropper.rotateTo(45).getImageData();
- assert.strictEqual(imageData.rotate, 45);
-
- imageData = cropper.scale(-1, -1).getImageData();
- assert.strictEqual(imageData.scaleX, -1);
- assert.strictEqual(imageData.scaleY, -1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/move.js b/library/cropperjs/test/methods/move.js
deleted file mode 100644
index c2ead8412..000000000
--- a/library/cropperjs/test/methods/move.js
+++ /dev/null
@@ -1,20 +0,0 @@
-QUnit.test('methods#move', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.move(1, 1).getCanvasData();
-
- assert.strictEqual(changedCanvasData.left, canvasData.left + 1);
- assert.strictEqual(changedCanvasData.top, canvasData.top + 1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/moveTo.js b/library/cropperjs/test/methods/moveTo.js
deleted file mode 100644
index e8bf0eebd..000000000
--- a/library/cropperjs/test/methods/moveTo.js
+++ /dev/null
@@ -1,19 +0,0 @@
-QUnit.test('methods#moveTo', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.moveTo(0, 0).getCanvasData();
-
- assert.strictEqual(canvasData.left, 0);
- assert.strictEqual(canvasData.top, 0);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/replace.js b/library/cropperjs/test/methods/replace.js
deleted file mode 100644
index 3fc8fe0b6..000000000
--- a/library/cropperjs/test/methods/replace.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('methods#replace', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- cropper.options.ready = function () {
- assert.notOk(cropper.cropped);
- cropper.crop();
- assert.ok(cropper.cropped);
- done();
- };
-
- cropper.options.autoCrop = false;
- cropper.replace('../docs/images/picture-2.jpg');
- }
- });
-});
diff --git a/library/cropperjs/test/methods/reset.js b/library/cropperjs/test/methods/reset.js
deleted file mode 100644
index 3e047394c..000000000
--- a/library/cropperjs/test/methods/reset.js
+++ /dev/null
@@ -1,35 +0,0 @@
-QUnit.test('methods#reset', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var cropBoxData = cropper.getCropBoxData();
-
- cropper.setCanvasData({
- top: canvasData.top + 10,
- width: canvasData.width - 10
- });
-
- assert.notDeepEqual(cropper.getCanvasData(), canvasData);
-
- cropper.setCropBoxData({
- left: cropBoxData.left + 10,
- height: cropBoxData.height - 10
- });
-
- assert.notDeepEqual(cropper.getCropBoxData(), cropBoxData);
-
- cropper.reset();
- assert.deepEqual(cropper.getCanvasData(), canvasData);
- assert.deepEqual(cropper.getCropBoxData(), cropBoxData);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/rotate.js b/library/cropperjs/test/methods/rotate.js
deleted file mode 100644
index 749096f0b..000000000
--- a/library/cropperjs/test/methods/rotate.js
+++ /dev/null
@@ -1,19 +0,0 @@
-QUnit.test('methods#rotate', 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;
-
- assert.strictEqual(cropper.rotate(360).getImageData().rotate, 0);
- assert.strictEqual(cropper.rotate(90).getImageData().rotate, 90);
- assert.strictEqual(cropper.rotate(-180).getImageData().rotate, -90);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/rotateTo.js b/library/cropperjs/test/methods/rotateTo.js
deleted file mode 100644
index 323431e76..000000000
--- a/library/cropperjs/test/methods/rotateTo.js
+++ /dev/null
@@ -1,20 +0,0 @@
-QUnit.test('methods#rotateTo', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.rotateTo(360).getImageData().rotate, 0);
- assert.strictEqual(cropper.rotateTo(90).getImageData().rotate, 90);
- assert.strictEqual(cropper.rotateTo(0).getImageData().rotate, 0);
- assert.strictEqual(cropper.rotateTo(-180).getImageData().rotate, -180);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/scale.js b/library/cropperjs/test/methods/scale.js
deleted file mode 100644
index be1caa589..000000000
--- a/library/cropperjs/test/methods/scale.js
+++ /dev/null
@@ -1,19 +0,0 @@
-QUnit.test('methods#scale', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.scale(-1, -1).getImageData();
-
- assert.strictEqual(imageData.scaleX, -1);
- assert.strictEqual(imageData.scaleY, -1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/scaleX.js b/library/cropperjs/test/methods/scaleX.js
deleted file mode 100644
index c799df58d..000000000
--- a/library/cropperjs/test/methods/scaleX.js
+++ /dev/null
@@ -1,18 +0,0 @@
-QUnit.test('methods#scaleX', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.scaleX(-1).getImageData();
-
- assert.strictEqual(imageData.scaleX, -1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/scaleY.js b/library/cropperjs/test/methods/scaleY.js
deleted file mode 100644
index 026b93a1f..000000000
--- a/library/cropperjs/test/methods/scaleY.js
+++ /dev/null
@@ -1,18 +0,0 @@
-QUnit.test('methods#scaleY', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.scaleY(-1).getImageData();
-
- assert.strictEqual(imageData.scaleY, -1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setAspectRatio.js b/library/cropperjs/test/methods/setAspectRatio.js
deleted file mode 100644
index ddf46798d..000000000
--- a/library/cropperjs/test/methods/setAspectRatio.js
+++ /dev/null
@@ -1,20 +0,0 @@
-QUnit.test('methods#setAspectRatio', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var options = cropper.options;
-
- assert.ok(isNaN(options.aspectRatio));
- cropper.setAspectRatio(1);
- assert.strictEqual(options.aspectRatio, 1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setCanvasData.js b/library/cropperjs/test/methods/setCanvasData.js
deleted file mode 100644
index e8f6511dc..000000000
--- a/library/cropperjs/test/methods/setCanvasData.js
+++ /dev/null
@@ -1,34 +0,0 @@
-QUnit.test('methods#setCanvasData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(6);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.setCanvasData({
- left: 16,
- top: 9
- }).getCanvasData();
-
- assert.notStrictEqual(changedCanvasData.left, canvasData.left);
- assert.notStrictEqual(changedCanvasData.top, canvasData.top);
- assert.strictEqual(changedCanvasData.width, canvasData.width);
- assert.strictEqual(changedCanvasData.height, canvasData.height);
-
- canvasData = cropper.getCanvasData();
- changedCanvasData = cropper.setCanvasData({
- width: 320,
- height: 180
- }).getCanvasData();
-
- assert.notStrictEqual(changedCanvasData.width, canvasData.width);
- assert.notStrictEqual(changedCanvasData.height, canvasData.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setCropBoxData.js b/library/cropperjs/test/methods/setCropBoxData.js
deleted file mode 100644
index e78767cfc..000000000
--- a/library/cropperjs/test/methods/setCropBoxData.js
+++ /dev/null
@@ -1,36 +0,0 @@
-QUnit.test('methods#setCropBoxData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(8);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var cropBoxData = cropper.getCropBoxData();
- var changedCropBoxData = cropper.setCropBoxData({
- left: 16,
- top: 9
- }).getCropBoxData();
-
- assert.notStrictEqual(changedCropBoxData.left, cropBoxData.left);
- assert.notStrictEqual(changedCropBoxData.top, cropBoxData.top);
- assert.strictEqual(changedCropBoxData.width, cropBoxData.width);
- assert.strictEqual(changedCropBoxData.height, cropBoxData.height);
-
- cropBoxData = cropper.getCropBoxData();
- changedCropBoxData = cropper.setCropBoxData({
- width: 320,
- height: 180
- }).getCropBoxData();
-
- assert.strictEqual(changedCropBoxData.left, cropBoxData.left);
- assert.strictEqual(changedCropBoxData.top, cropBoxData.top);
- assert.notStrictEqual(changedCropBoxData.width, cropBoxData.width);
- assert.notStrictEqual(changedCropBoxData.height, cropBoxData.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setData.js b/library/cropperjs/test/methods/setData.js
deleted file mode 100644
index 4e1360f09..000000000
--- a/library/cropperjs/test/methods/setData.js
+++ /dev/null
@@ -1,36 +0,0 @@
-QUnit.test('methods#setData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(8);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var data = cropper.getData();
- var changedData = cropper.setData({
- x: 16,
- y: 9
- }).getData();
-
- assert.notStrictEqual(changedData.x, data.x);
- assert.notStrictEqual(changedData.y, data.y);
- assert.strictEqual(changedData.width, data.width);
- assert.strictEqual(changedData.height, data.height);
-
- data = cropper.getData();
- changedData = cropper.setData({
- width: 320,
- height: 180
- }).getData();
-
- assert.strictEqual(changedData.x, data.x);
- assert.strictEqual(changedData.y, data.y);
- assert.notStrictEqual(changedData.width, data.width);
- assert.notStrictEqual(changedData.height, data.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setDragMode.js b/library/cropperjs/test/methods/setDragMode.js
deleted file mode 100644
index 1b611af9b..000000000
--- a/library/cropperjs/test/methods/setDragMode.js
+++ /dev/null
@@ -1,27 +0,0 @@
-QUnit.test('methods#setDragMode', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var dragBox = cropper.dragBox;
-
- assert.strictEqual(dragBox.dataset.action, 'crop');
-
- cropper.setDragMode('move');
- assert.strictEqual(dragBox.dataset.action, 'move');
-
- cropper.setDragMode('crop');
- assert.strictEqual(dragBox.dataset.action, 'crop');
-
- cropper.setDragMode('none');
- assert.strictEqual(dragBox.dataset.action, 'none');
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/zoom.js b/library/cropperjs/test/methods/zoom.js
deleted file mode 100644
index 70a1a763a..000000000
--- a/library/cropperjs/test/methods/zoom.js
+++ /dev/null
@@ -1,20 +0,0 @@
-QUnit.test('methods#zoom', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.zoom(0.1).getCanvasData();
-
- assert.ok(changedCanvasData.width > canvasData.width);
- assert.ok(changedCanvasData.height > canvasData.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/zoomTo.js b/library/cropperjs/test/methods/zoomTo.js
deleted file mode 100644
index dd9e81760..000000000
--- a/library/cropperjs/test/methods/zoomTo.js
+++ /dev/null
@@ -1,21 +0,0 @@
-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();
- }
- });
-});