test: add tests for dataset document detail (#31274)

Co-authored-by: CodingOnStar <hanxujiang@dify.ai>
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
This commit is contained in:
Coding On Star
2026-01-27 15:43:27 +08:00
committed by GitHub
parent eca26a9b9b
commit c8abe1c306
105 changed files with 28225 additions and 686 deletions

View File

@@ -90,6 +90,14 @@ afterEach(async () => {
// mock next/image to avoid width/height requirements for data URLs
vi.mock('next/image')
// mock foxact/use-clipboard - not available in test environment
vi.mock('foxact/use-clipboard', () => ({
useClipboard: () => ({
copy: vi.fn(),
copied: false,
}),
}))
// mock zustand - auto-resets all stores after each test
// Based on official Zustand testing guide: https://zustand.docs.pmnd.rs/guides/testing
vi.mock('zustand')