mirror of
https://github.com/langgenius/dify.git
synced 2026-10-28 03:35:04 +08:00
fix(web): localize error boundary copy (#34332)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
copilot-swe-agent[bot]
parent
f27d669f87
commit
b54a0dc1e4
+10
-2
@@ -3,9 +3,17 @@ import type { TriggerSubscription } from '@/app/components/workflow/block-select
|
||||
import { fireEvent, render, screen } from '@testing-library/react'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { TriggerCredentialTypeEnum } from '@/app/components/workflow/block-selector/types'
|
||||
import { createReactI18nextMock } from '@/test/i18n-mock'
|
||||
import { SubscriptionList } from '../index'
|
||||
import { SubscriptionListMode } from '../types'
|
||||
|
||||
vi.mock('react-i18next', () => createReactI18nextMock({
|
||||
'errorBoundary.title': 'Something went wrong',
|
||||
'errorBoundary.message': 'An unexpected error occurred while rendering this component.',
|
||||
'errorBoundary.tryAgain': 'Try Again',
|
||||
'errorBoundary.reloadPage': 'Reload Page',
|
||||
}))
|
||||
|
||||
const mockRefetch = vi.fn()
|
||||
let mockSubscriptionListError: Error | null = null
|
||||
let mockSubscriptionListState: {
|
||||
@@ -209,12 +217,12 @@ describe('SubscriptionList', () => {
|
||||
})
|
||||
|
||||
describe('Edge Cases', () => {
|
||||
it('should render error boundary fallback when an error occurs', () => {
|
||||
it('should render error boundary fallback when an error occurs', async () => {
|
||||
mockSubscriptionListError = new Error('boom')
|
||||
|
||||
render(<SubscriptionList />)
|
||||
|
||||
expect(screen.getByText('Something went wrong')).toBeInTheDocument()
|
||||
expect(await screen.findByText('Something went wrong')).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user