refactor(ui): 统一迁移原生按钮、输入框及交互控件

This commit is contained in:
Wxw-Gu
2026-08-20 10:18:59 +08:00
parent e9cc996ebb
commit 65830d70fe
87 changed files with 3685 additions and 2768 deletions
+11
View File
@@ -27,6 +27,7 @@ describe('CacheCleanupPage', () => {
updatedAt: Date.now()
})
api.openKnowledgeDirectory.mockResolvedValue({ success: true })
api.clearCache.mockResolvedValue({ items: [], totalBytes: 0, updatedAt: Date.now() })
})
it('opens the real knowledge directory without clearing it', async () => {
@@ -39,4 +40,14 @@ describe('CacheCleanupPage', () => {
expect(api.clearCache).not.toHaveBeenCalled()
expect(onNotice).toHaveBeenCalledWith('已打开知识库文件夹')
})
it('keeps the clear-all scope and notice unchanged', async () => {
const onNotice = vi.fn()
render(<CacheCleanupPage onNotice={onNotice} />)
await userEvent.click(await screen.findByRole('button', { name: '清理全部' }))
await waitFor(() => expect(api.clearCache).toHaveBeenCalledWith('all'))
expect(onNotice).toHaveBeenCalledWith('已清理全部可恢复缓存和检索记录')
})
})