mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
fix(vitest): adjust mock classes
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
parent
b00a55bcb5
commit
d57b9d40fe
1 changed files with 15 additions and 15 deletions
|
|
@ -50,12 +50,6 @@ vi.mock('@nextcloud/capabilities', () => ({
|
|||
|
||||
HTMLAudioElement.prototype.setSinkId = vi.fn()
|
||||
|
||||
window.IntersectionObserver = vi.fn(() => ({
|
||||
observe: vi.fn(),
|
||||
unobserve: vi.fn(),
|
||||
disconnect: vi.fn(),
|
||||
}))
|
||||
|
||||
window._oc_webroot = '/nc-webroot' // used by getRootUrl() | since @nextcloud/router 2.2.1
|
||||
|
||||
global.appName = 'spreed'
|
||||
|
|
@ -122,16 +116,22 @@ function myArrayBuffer() {
|
|||
|
||||
global.Blob.prototype.arrayBuffer = Blob.prototype.arrayBuffer || myArrayBuffer
|
||||
|
||||
global.BroadcastChannel = vi.fn(() => ({
|
||||
postMessage: vi.fn(),
|
||||
addEventListener: vi.fn(),
|
||||
}))
|
||||
global.BroadcastChannel = vi.fn(class {
|
||||
postMessage = vi.fn()
|
||||
addEventListener = vi.fn()
|
||||
})
|
||||
|
||||
global.ResizeObserver = vi.fn(() => ({
|
||||
observe: vi.fn(),
|
||||
unobserve: vi.fn(),
|
||||
disconnect: vi.fn(),
|
||||
}))
|
||||
global.IntersectionObserver = vi.fn(class {
|
||||
observe = vi.fn()
|
||||
unobserve = vi.fn()
|
||||
disconnect = vi.fn()
|
||||
})
|
||||
|
||||
global.ResizeObserver = vi.fn(class {
|
||||
observe = vi.fn()
|
||||
unobserve = vi.fn()
|
||||
disconnect = vi.fn()
|
||||
})
|
||||
|
||||
global.structuredClone = vi.fn((val) => JSON.parse(JSON.stringify(val)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue