import { clearCrossOriginForCORSIfNotSameOrigin } from './imageHelper';
describe('clearCrossOriginForCORSIfNotSameOrigin tests', function () {
    var savedLocation = window.location;
    beforeEach(function () {
        delete window.location;
        window.location = {
            origin: 'http://test'
        };
    });
    afterEach(function () {
        window.location = savedLocation;
    });
    it('should clear crossOrigin if origin is not the same', function () {
        var img = new Image();
        var url = 'http://imagePath/images/123.png';
        img.crossOrigin = 'testValue';
        clearCrossOriginForCORSIfNotSameOrigin(img, url);
        expect(img.crossOrigin).toBe('');
    });
    it('should not clear crossOrigin if origin is the same', function () {
        var img = new Image();
        var url = 'http://test/images/123.png';
        img.crossOrigin = 'testValue';
        clearCrossOriginForCORSIfNotSameOrigin(img, url);
        expect(img.crossOrigin).toBe('testValue');
    });
});
