fix: refactor document focus handling in test files - tests were failing in gitea CI
This commit is contained in:
parent
befc7df583
commit
850a1b2eca
4 changed files with 12 additions and 4 deletions
|
|
@ -8,7 +8,9 @@ globalThis.useNotificationStore = () => ({
|
|||
markRead: () => {},
|
||||
}) as any
|
||||
|
||||
;(globalThis.document as any).hasFocus = () => true
|
||||
const documentStub: any = globalThis.document ?? {}
|
||||
documentStub.hasFocus = () => true
|
||||
;(globalThis as any).document = documentStub
|
||||
|
||||
mock.module('~/composables/useNotification', () => ({
|
||||
useNotification: () => ({ success: successMock, error: errorMock }),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ globalThis.useNotificationStore = () => ({
|
|||
markRead: () => {},
|
||||
}) as any
|
||||
|
||||
;(globalThis.document as any).hasFocus = () => true
|
||||
const documentStub: any = globalThis.document ?? {}
|
||||
documentStub.hasFocus = () => true
|
||||
;(globalThis as any).document = documentStub
|
||||
|
||||
mock.module('~/composables/useNotification', () => ({
|
||||
useNotification: () => ({ success: successMock, error: errorMock }),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ globalThis.useNotificationStore = () => ({
|
|||
markRead: () => {},
|
||||
}) as any
|
||||
|
||||
;(globalThis.document as any).hasFocus = () => true
|
||||
const documentStub: any = globalThis.document ?? {}
|
||||
documentStub.hasFocus = () => true
|
||||
;(globalThis as any).document = documentStub
|
||||
|
||||
mock.module('~/composables/useNotification', () => ({
|
||||
useNotification: () => ({ success: successMock, error: errorMock }),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ globalThis.useNotificationStore = () => ({
|
|||
markRead: () => {},
|
||||
}) as any
|
||||
|
||||
;(globalThis.document as any).hasFocus = () => true
|
||||
const documentStub: any = globalThis.document ?? {}
|
||||
documentStub.hasFocus = () => true
|
||||
;(globalThis as any).document = documentStub
|
||||
|
||||
mock.module('~/composables/useNotification', () => ({
|
||||
useNotification: () => ({ success: successMock, error: errorMock }),
|
||||
|
|
|
|||
Loading…
Reference in a new issue