2019-07-23 19:51:08 +03:00
|
|
|
/***********************************************************
|
|
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
* Licensed under the MIT License
|
|
|
|
**********************************************************/
|
|
|
|
import { setIconOptions } from "office-ui-fabric-react/lib/Styling";
|
|
|
|
import * as Enzyme from "enzyme";
|
|
|
|
import * as Adapter from "enzyme-adapter-react-16";
|
|
|
|
|
2019-09-09 23:33:09 +03:00
|
|
|
global['Headers'] = () => {};
|
|
|
|
window.parent.fetch = jest.fn();
|
|
|
|
|
2019-07-23 19:51:08 +03:00
|
|
|
// suppress icon warnings.
|
|
|
|
setIconOptions({
|
|
|
|
disableWarnings: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
Enzyme.configure({ adapter: new Adapter() });
|
2019-08-22 23:32:17 +03:00
|
|
|
document.execCommand = jest.fn(); // maskedCopyableTextField
|
2019-07-31 21:35:22 +03:00
|
|
|
|
|
|
|
// fix for smooth-dnd invocation error in test
|
|
|
|
Object.defineProperty(global, 'Node', {
|
|
|
|
value: {firstElementChild: jest.fn()}
|
|
|
|
});
|
2019-12-24 00:19:32 +03:00
|
|
|
|
|
|
|
jest.mock('i18next', () => ({
|
|
|
|
t: (key: string) => key
|
|
|
|
}));
|