window.fetch = require('jest-fetch-mock');

// Mock the Date object and allows us to use Date.now() and get a consistent date back
const mockedCurrentDate = new Date("2017-10-06T13:45:28.975Z");
require('jest-mock-now')(mockedCurrentDate);

// Mock document functions (specifically for the CollectionsController component)
const mockedGetElement = () => ({
    getBoundingClientRect: () => ({
        top: 0
    }),
    scrollTop: 0
});
Object.defineProperty(document, 'getElementById', {
    value: mockedGetElement,
});
window.fetch = require('jest-fetch-mock');

// Mock the Date object and allows us to use Date.now() and get a consistent date back
const mockedCurrentDate = new Date("2017-10-06T13:45:28.975Z");
require('jest-mock-now')(mockedCurrentDate);

// Mock document functions (specifically for the CollectionsController component)
const mockedGetElement = () => ({
    getBoundingClientRect: () => ({
        top: 0
    }),
    scrollTop: 0,
    scrollIntoView: () => {}
});
Object.defineProperty(document, 'getElementById', {
    value: mockedGetElement,
});
Fix breaking unit tests due to missing mock of scrollIntoView function
Fix breaking unit tests due to missing mock of scrollIntoView function
