mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-21 21:47:00 +08:00
refactor(ui): 统一迁移原生按钮、输入框及交互控件
This commit is contained in:
@@ -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('已清理全部可恢复缓存和检索记录')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user