mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
refactor: create shared react-i18next mock to reduce duplication (#29711)
This commit is contained in:
@ -2,12 +2,6 @@ import React from 'react'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import NoData from './index'
|
||||
|
||||
jest.mock('react-i18next', () => ({
|
||||
useTranslation: () => ({
|
||||
t: (key: string) => key,
|
||||
}),
|
||||
}))
|
||||
|
||||
describe('NoData', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
|
||||
@ -2,12 +2,6 @@ import React from 'react'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import ResDownload from './index'
|
||||
|
||||
jest.mock('react-i18next', () => ({
|
||||
useTranslation: () => ({
|
||||
t: (key: string) => key,
|
||||
}),
|
||||
}))
|
||||
|
||||
const mockType = { Link: 'mock-link' }
|
||||
let capturedProps: Record<string, unknown> | undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user