blob: e060d9794692eb1112898ff81f55fbe89c7715e2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
describe('reset (method)', () => {
it('should reset the cropper to its initial state', (done) => {
const image = window.createImage();
const cropper = new Cropper(image, {
ready() {
const canvasData = cropper.getCanvasData();
const cropBoxData = cropper.getCropBoxData();
cropper.setCanvasData({
top: canvasData.top + 10,
width: canvasData.width - 10,
});
expect(cropper.getCanvasData()).to.not.deep.equal(canvasData);
cropper.setCropBoxData({
left: cropBoxData.left + 10,
height: cropBoxData.height - 10,
});
expect(cropper.getCropBoxData()).to.not.deep.equal(cropBoxData);
cropper.reset();
expect(cropper.getCanvasData()).to.deep.equal(canvasData);
expect(cropper.getCropBoxData()).to.deep.equal(cropBoxData);
done();
},
});
});
});
|