fix(tests): update tests for react-cool-dimensions 2.0.3

This commit is contained in:
Łukasz Mierzwa
2021-04-27 14:07:20 +01:00
committed by Łukasz Mierzwa
parent 874c9ece5b
commit cf44458bbf
2 changed files with 10 additions and 0 deletions

View File

@@ -35,6 +35,11 @@ beforeEach(() => {
window.matchMedia = mockMatchMedia({});
window.requestAnimationFrame = (cb: FrameRequestCallback) => {
cb(0);
return 0;
};
jest.spyOn(React, "useContext").mockImplementation(() => MockThemeContext);
Object.defineProperty(document.body, "clientWidth", {

View File

@@ -35,6 +35,11 @@ beforeEach(() => {
// fix startsAt & endsAt dates so they don't change between tests
silenceFormStore.data.setStart(new Date(Date.UTC(2018, 1, 30, 10, 25, 50)));
silenceFormStore.data.setEnd(new Date(Date.UTC(2018, 1, 30, 11, 25, 50)));
jest.spyOn(window, "requestAnimationFrame").mockImplementation((cb) => {
cb(0);
return 0;
});
});
afterEach(() => {