aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/options/dragMode.js
diff options
context:
space:
mode:
Diffstat (limited to 'library/cropperjs/test/options/dragMode.js')
-rw-r--r--library/cropperjs/test/options/dragMode.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/library/cropperjs/test/options/dragMode.js b/library/cropperjs/test/options/dragMode.js
new file mode 100644
index 000000000..57f31ff13
--- /dev/null
+++ b/library/cropperjs/test/options/dragMode.js
@@ -0,0 +1,60 @@
+QUnit.test('options#dragMode: crop', function (assert) {
+ var done = assert.async();
+ var util = window.Util;
+ var image = util.createImage();
+
+ assert.expect(1);
+
+ return new Cropper(image, {
+ // dragMode: 'crop',
+
+ ready: function () {
+ var cropper = this.cropper;
+
+ assert.strictEqual(cropper.dragBox.dataset.action, 'crop');
+
+ done();
+ }
+ });
+});
+
+QUnit.test('options#dragMode: move', function (assert) {
+ var done = assert.async();
+ var util = window.Util;
+ var image = util.createImage();
+
+ assert.expect(1);
+
+ return new Cropper(image, {
+ dragMode: 'move',
+
+ ready: function () {
+ var cropper = this.cropper;
+
+ assert.strictEqual(cropper.dragBox.dataset.action, 'move');
+
+ done();
+ }
+ });
+});
+
+
+QUnit.test('options#dragMode: none', function (assert) {
+ var done = assert.async();
+ var util = window.Util;
+ var image = util.createImage();
+
+ assert.expect(1);
+
+ return new Cropper(image, {
+ dragMode: 'none',
+
+ ready: function () {
+ var cropper = this.cropper;
+
+ assert.strictEqual(cropper.dragBox.dataset.action, 'none');
+
+ done();
+ }
+ });
+});