diff --git a/client/src/components/Chat/Footer.tsx b/client/src/components/Chat/Footer.tsx index 90d78737b9..79413c7f68 100644 --- a/client/src/components/Chat/Footer.tsx +++ b/client/src/components/Chat/Footer.tsx @@ -63,7 +63,8 @@ function Footer({ className, startupConfig }: FooterProps) { {children} diff --git a/client/src/components/Chat/__tests__/Footer.spec.tsx b/client/src/components/Chat/__tests__/Footer.spec.tsx new file mode 100644 index 0000000000..c855b746f0 --- /dev/null +++ b/client/src/components/Chat/__tests__/Footer.spec.tsx @@ -0,0 +1,56 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react'; +import '@testing-library/jest-dom/extend-expect'; +import Footer from '../Footer'; + +jest.mock('react-gtm-module', () => ({ + __esModule: true, + default: { initialize: jest.fn() }, +})); + +jest.mock('~/data-provider', () => ({ + useGetStartupConfig: jest.fn(() => ({ data: undefined, isFetching: false, error: null })), +})); + +const mockTranslations: Record = { + com_ui_latest_footer: 'Every AI for Everyone.', + com_ui_privacy_policy: 'Privacy policy', + com_ui_terms_of_service: 'Terms of service', +}; + +jest.mock('~/hooks', () => ({ + useLocalize: () => (key: string) => mockTranslations[key] ?? key, +})); + +describe('Footer', () => { + test('opens the default LibreChat site link in a new tab', () => { + render(