mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 09:15:41 +08:00
refactor(ui): 统一迁移原生按钮、输入框及交互控件
This commit is contained in:
1 parent
49d4e17d67
commit
d93caa3539
87 files changed
+3685
-2768
No files matched your search
@@ -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