mirror of
https://github.com/oxynote/oxynote.git
synced 2026-10-18 03:19:19 +02:00
23 lines
798 B
TypeScript
23 lines
798 B
TypeScript
import { describe, it, vi } from "vitest"
|
|
import plugin from "./electron-auth.client"
|
|
|
|
describe("electron-auth.client", () => {
|
|
// the desktop wiring is compile-time dead in the client web bundle
|
|
// tests run in — see the NOCOV marker in the plugin
|
|
it("does not subscribe to the auth bridges in web builds", ({ expect }) => {
|
|
const onAuthenticated = vi.fn()
|
|
const onUserUpdated = vi.fn()
|
|
const onAuthError = vi.fn()
|
|
vi.stubGlobal("onAuthenticated", onAuthenticated)
|
|
vi.stubGlobal("onUserUpdated", onUserUpdated)
|
|
vi.stubGlobal("onAuthError", onAuthError)
|
|
|
|
const result = plugin(useNuxtApp())
|
|
|
|
expect(result).toBeUndefined()
|
|
expect(onAuthenticated).toHaveBeenCalledTimes(0)
|
|
expect(onUserUpdated).toHaveBeenCalledTimes(0)
|
|
expect(onAuthError).toHaveBeenCalledTimes(0)
|
|
})
|
|
})
|