feat: restructure notification services

This commit is contained in:
fawney19
2026-05-22 01:45:46 +08:00
parent d5e64d6ad9
commit 504c1ccb37
28 changed files with 1941 additions and 460 deletions
@@ -247,7 +247,7 @@
额度提醒
</Label>
<p class="mt-1 text-xs text-muted-foreground">
余额低于阈值时通过重要通知发送提醒
余额低于阈值时通过通知服务发送提醒
</p>
</div>
<Switch v-model="quotaAlert.enabled" />
@@ -14,7 +14,16 @@ const endpointMocks = vi.hoisted(() => ({
getAwsRegions: vi.fn(),
}))
vi.mock('@/api/endpoints', () => endpointMocks)
vi.mock('@/api/endpoints', async () => {
const actual = await vi.importActual<typeof import('@/api/endpoints/provider_oauth')>(
'@/api/endpoints/provider_oauth',
)
return {
...endpointMocks,
normalizeBatchImportCredentials: actual.normalizeBatchImportCredentials,
}
})
vi.mock('@/components/ui', async () => {
const { defineComponent, h } = await import('vue')
@@ -358,7 +367,7 @@ describe('OAuthAccountDialog Grok import', () => {
expect(endpointMocks.startBatchImportOAuthTask).toHaveBeenCalledWith(
'provider-1',
'sso-1\nsso-2',
'["sso-1","sso-2"]',
undefined,
)
expect(endpointMocks.importProviderRefreshToken).not.toHaveBeenCalled()