Skip to content
Snippets Groups Projects
Select Git revision
  • fd236dcb8581ca647b90793e29578fbdd2709bc0
  • mui5-annotation-on-video-stable default
  • get_setter_canvasSizeInformations
  • fix-error-div-into-p
  • annotation-on-video-v2
  • detached
  • annotation-on-video-r17
  • mui5
  • mui5-react-18
  • jacob-test
  • annotation-on-video protected
  • master
  • test-antoinev1
  • 20-fetch-thumbnail-on-annotation
  • add-research-field
  • Save
  • add-plugin
  • 14-wip-no-seek-to
  • 14-bug-on-video-time-control
  • 9_wip_videotests
  • _upgrade_material_ui
  • latest-tetras-16
  • v3.3.0
  • v3.2.0
  • v3.1.1
  • v3.1.0
  • v3.0.0
  • v3.0.0-rc.7
  • v3.0.0-rc.6
  • v3.0.0-rc.5
  • v3.0.0-rc.4
  • v3.0.0-rc.3
  • v3.0.0-rc.2
  • v3.0.0-rc.1
  • v3.0.0-beta.10
  • v3.0.0-beta.9
  • v3.0.0-beta.8
  • v3.0.0-beta.7
  • v3.0.0-beta.6
  • v3.0.0-beta.5
  • v3.0.0-beta.3
41 results

WindowSideBarAnnotationsPanel.js

Blame
  • setupJest.js 2.13 KiB
    // Setup Jest to mock fetch
    
    // import { JSDOM } from 'jsdom'; // eslint-disable-line import/no-extraneous-dependencies
    import fetch from 'jest-fetch-mock'; // eslint-disable-line import/no-extraneous-dependencies
    // import Enzyme from 'enzyme'; // eslint-disable-line import/no-extraneous-dependencies
    // import Adapter from 'enzyme-adapter-react-16'; // eslint-disable-line import/no-extraneous-dependencies
    
    // const jsdom = new JSDOM('<!doctype html><html><body><div id="main"></div></body></html>', { url: 'https://localhost' });
    // const { window } = jsdom;
    
    jest.setTimeout(10000);
    
    // window.HTMLCanvasElement.prototype.getContext = () => {};
    jest.setMock('isomorphic-unfetch', fetch);
    require('jest-fetch-mock').enableMocks(); // eslint-disable-line import/no-extraneous-dependencies
    
    // global.window = window;
    // global.navigator = {
    //   userAgent: 'node.js',
    // };
    // 
    // /* eslint-disable  require-jsdoc, class-methods-use-this */
    // class IntersectionObserverPolyfill {
    //   observe() {
    //   }
    // 
    //   disconnect() {
    //   }
    // }
    // /* eslint-enable  require-jsdoc, class-methods-use-this */
    // 
    // global.IntersectionObserver = IntersectionObserverPolyfill;
    // 
    // /** */
    // function Path2D() {
    // }
    // 
    // global.Path2D = Path2D;
    // /**
    //  * copy object property descriptors from `src` to `target`
    //  * @param {*} src
    //  * @param {*} target
    //  */
    // const copyProps = (src, target) => {
    //   Object.defineProperties(target, {
    //     ...Object.getOwnPropertyDescriptors(src),
    //     ...Object.getOwnPropertyDescriptors(target),
    //   });
    // };
    // 
    // /*
    //   avoid 'ReferenceError: HTMLElement is not defined'
    //   see https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md
    //   for further information
    // */
    // copyProps(window, global);
    // 
    // Enzyme.configure({ adapter: new Adapter() });
    // 
    // jest.mock('react-i18next', () => ({
    //   // this mock makes sure any components using the translate HoC receive the t function as a prop
    //   withTranslation: () => (Component) => {
    //     Component.defaultProps = { // eslint-disable-line no-param-reassign
    //       ...Component.defaultProps, t: k => k,
    //     };
    //     return Component;
    //   },
    // }));