fix(public): keep original GitHub links visible

(cherry picked from commit 7c93552697c9c35b77df35e117900ff8e9b62994)
This commit is contained in:
fawney19
2026-05-16 09:17:37 +08:00
parent f72ab383c9
commit b6d74249a4
4 changed files with 113 additions and 4 deletions

View File

@@ -0,0 +1,32 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
const apiClientMocks = vi.hoisted(() => ({
get: vi.fn(),
}))
vi.mock('@/api/client', () => ({
default: apiClientMocks,
}))
describe('useSiteInfo', () => {
beforeEach(() => {
vi.resetModules()
apiClientMocks.get.mockReset()
})
it('loads public site info', async () => {
apiClientMocks.get.mockResolvedValue({
data: {
site_name: 'Custom Aether',
site_subtitle: 'Gateway',
},
})
const { useSiteInfo } = await import('../useSiteInfo')
const { siteName, siteSubtitle, refreshSiteInfo } = useSiteInfo()
await refreshSiteInfo()
expect(siteName.value).toBe('Custom Aether')
expect(siteSubtitle.value).toBe('Gateway')
})
})