mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
fix(public): keep original GitHub links visible
(cherry picked from commit 7c93552697c9c35b77df35e117900ff8e9b62994)
This commit is contained in:
32
frontend/src/composables/__tests__/useSiteInfo.spec.ts
Normal file
32
frontend/src/composables/__tests__/useSiteInfo.spec.ts
Normal 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')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user