Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
test: add test for $.fn.cropper.noConflict
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Oct 12, 2019
1 parent c931607 commit ee1b4ac
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import $ from 'jquery';
import '../src';

describe('cropper', () => {
const createImage = () => {
const container = document.createElement('div');
Expand Down Expand Up @@ -62,4 +65,15 @@ describe('cropper', () => {
done();
}).cropper();
});

it('should rollback when call the $.fn.cropper.conflict', () => {
const { cropper } = $.fn;
const noConflictCropper = $.fn.cropper.noConflict();

expect(noConflictCropper).to.equal(cropper);
expect($.fn.cropper).to.be.undefined;

// Reverts it for the rest test suites
$.fn.cropper = noConflictCropper;
});
});

0 comments on commit ee1b4ac

Please sign in to comment.