aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/specs/methods/replace.spec.js
blob: 378cb0af8d05e9459bbd7b1094d242eea5657719 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
describe('replace (method)', () => {
  it('should replace the image url with a new one', (done) => {
    const image = window.createImage();
    const imageURL = '/base/docs/images/picture-2.jpg';
    const cropper = new Cropper(image, {
      ready() {
        cropper.options.ready = () => {
          expect(image.src).to.include(imageURL);
          done();
        };

        expect(image.src).to.not.include(imageURL);
        cropper.replace(imageURL);
      },
    });
  });
});