mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
test: add unit tests for base components (#32818)
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
This commit is contained in:
@ -2,7 +2,7 @@ import { render, screen, waitFor } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { audioToText } from '@/service/share'
|
||||
import VoiceInput from './index'
|
||||
import VoiceInput from '../index'
|
||||
|
||||
const { mockState, MockRecorder } = vi.hoisted(() => {
|
||||
const state = {
|
||||
@ -50,7 +50,7 @@ vi.mock('next/navigation', () => ({
|
||||
usePathname: vi.fn(() => mockState.pathname),
|
||||
}))
|
||||
|
||||
vi.mock('./utils', () => ({
|
||||
vi.mock('../utils', () => ({
|
||||
convertToMp3: vi.fn(() => new Blob(['test'], { type: 'audio/mp3' })),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user