aboutsummaryrefslogblamecommitdiffstats
path: root/library/cropperjs/test/specs/events/ready.spec.js
blob: fd88314f0ca9b22f6513fd188374743dbd5b5179 (plain) (tree)

























                                                                                 
describe('ready (event)', () => {
  it('should trigger the `ready` event', (done) => {
    const image = window.createImage();

    image.addEventListener('ready', (event) => {
      expect(event.type).to.equal('ready');
      done();
    });

    new Cropper(image);
  });

  it('should trigger the `crop` event even though default prevented', (done) => {
    const image = window.createImage();

    image.addEventListener('ready', (event) => {
      event.preventDefault();
    });

    image.addEventListener('crop', () => {
      done();
    });

    new Cropper(image);
  });
});