Skip to content

Commit

Permalink
Added mock implementations of HTMLElement.prototype functions that ar…
Browse files Browse the repository at this point in the history
…e still not implemented in react and cause errors upon app tests
  • Loading branch information
ivanvpetrov committed Jun 28, 2024
1 parent 3db02bb commit 702ef72
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import '@testing-library/jest-dom'
import 'vitest-canvas-mock'
import ResizeObserver from 'resize-observer-polyfill'
import {vi} from 'vitest'

global.ResizeObserver = ResizeObserver;

HTMLElement.prototype.scrollIntoView = vi.fn();
HTMLElement.prototype.hidePopover = vi.fn();
HTMLElement.prototype.showPopover = vi.fn();
HTMLElement.prototype.togglePopover = vi.fn();

0 comments on commit 702ef72

Please sign in to comment.