aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/specs/methods/getContainerData.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'library/cropperjs/test/specs/methods/getContainerData.spec.js')
-rw-r--r--library/cropperjs/test/specs/methods/getContainerData.spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/library/cropperjs/test/specs/methods/getContainerData.spec.js b/library/cropperjs/test/specs/methods/getContainerData.spec.js
new file mode 100644
index 000000000..7ab676277
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/getContainerData.spec.js
@@ -0,0 +1,23 @@
+describe('getContainerData (method)', () => {
+ it('should get an empty object when it is not ready', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+ const containerData = cropper.getContainerData();
+
+ expect(containerData).to.be.an('object').that.is.empty;
+ });
+
+ it('should get expect container data when ready', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const containerData = cropper.getContainerData();
+
+ expect(containerData).to.be.an('object').that.has.all.keys(['width', 'height']);
+ expect(containerData.width).to.be.a('number');
+ expect(containerData.height).to.be.a('number');
+ done();
+ },
+ });
+ });
+});