Fixed tests

feature/109
Christoph Oberhofer 9 years ago
parent 435430b8fa
commit 5ee361bcff

@ -18,4 +18,8 @@ const DOMHelper = windowObjects.reduce((result, obj) => {
};
}, {});
DOMHelper.setObject = (key, value) => {
DOMHelper[key] = value;
};
export default DOMHelper;

@ -1,4 +1,5 @@
import {createConfigFromSource} from '../../src/input/config_factory';
import DOMHelper from '../../src/common/dom_helper';
function MyFileList(file) {
Array.call(this);
@ -7,7 +8,7 @@ function MyFileList(file) {
MyFileList.prototype = Object.create(Array.prototype);
MyFileList.prototype.constructor = MyFileList;
const OriginalFileList = window.FileList;
const OriginalFileList = DOMHelper.FileList;
function expectImageConfig(config) {
expect(config.inputStream.type).to.equal("ImageStream");
@ -30,11 +31,11 @@ function expectLiveConfig(config) {
describe("createConfigFromSource", () => {
beforeEach(function() {
window.FileList = MyFileList;
DOMHelper.setObject('FileList', MyFileList);
});
afterEach(function() {
window.FileList = OriginalFileList;
DOMHelper.setObject('FileList', OriginalFileList);
});
it("should create an image config for an image-file", () => {

Loading…
Cancel
Save