fix: document title error at studio page
parent
74cc4c0ce8
commit
94c64b661e
@ -0,0 +1,12 @@
|
||||
'use client'
|
||||
|
||||
import useDocumentTitle from '@/hooks/use-document-title'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export default function DatasetsLayout({ children }: { children: React.ReactNode }) {
|
||||
const { t } = useTranslation()
|
||||
useDocumentTitle(t('common.menus.apps'))
|
||||
return (<>
|
||||
{children}
|
||||
</>)
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import { defaultSystemFeatures } from '@/types/feature'
|
||||
import { renderHook } from '@testing-library/react'
|
||||
import useDocumentTitle from './use-document-title'
|
||||
|
||||
jest.mock('@/context/global-public-context', () => ({
|
||||
useGlobalPublicStore: jest.fn(() => ({ ...defaultSystemFeatures })),
|
||||
}))
|
||||
|
||||
describe('branding.enabled is false', () => {
|
||||
it('document title should be test-Dify if set title', () => {
|
||||
renderHook(() => useDocumentTitle('test'))
|
||||
expect(document.title).toBe('test - Dify')
|
||||
})
|
||||
|
||||
it('document title should be Dify if not set title', () => {
|
||||
renderHook(() => useDocumentTitle(''))
|
||||
expect(document.title).toBe('Dify')
|
||||
})
|
||||
})
|
||||
Loading…
Reference in New Issue