mirror of
https://github.com/langgenius/dify.git
synced 2026-03-29 01:49:57 +08:00
test: update unit tests to use Vitest framework
- Refactored test files for data source options, drawer, and pipeline settings to utilize Vitest for improved testing capabilities. - Ensured consistent testing practices across components by importing necessary Vitest functions.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import type { DataSourceNodeType } from '@/app/components/workflow/nodes/data-source/types'
|
||||
import { renderHook } from '@testing-library/react'
|
||||
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { useDatasourceIcon } from './hooks'
|
||||
|
||||
const mockTransformDataSourceToTool = vi.fn()
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react'
|
||||
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import Drawer from './drawer'
|
||||
|
||||
// Capture the useKeyPress callback so tests can invoke it
|
||||
let capturedKeyPressCallback: ((e: KeyboardEvent) => void) | undefined
|
||||
|
||||
vi.mock('ahooks', () => ({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { renderHook } from '@testing-library/react'
|
||||
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { useInputVariables } from './hooks'
|
||||
|
||||
let mockPipelineId: string | undefined
|
||||
|
||||
Reference in New Issue
Block a user