✨ feat(analytics): add PrivacyPolicy page

This commit is contained in:
2025-05-28 10:35:44 +00:00
parent 2547572e1c
commit 585aed9233
8 changed files with 447 additions and 4 deletions
@@ -0,0 +1,24 @@
import React from 'react'
import { screen } from '@testing-library/react'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { useAnalytics } from 'use-analytics'
import { renderWithRouter as render } from 'components/utils/tests/index.js'
import PrivacyPage from './index.js'
// Mock the analytics module
vi.mock('use-analytics', () => ({
useAnalytics: () => ({ plugins: { enable: vi.fn(), disable: vi.fn() } }),
}))
describe('PrivacyPage', () => {
it('renders the Privacy Policy page', () => {
render(<PrivacyPage />)
expect(screen.getAllByText('Privacy Policy')).toHaveLength(3) // title, body (cookie preferences section) and footer
expect(screen.getByText('Google Analytics')).toBeInTheDocument()
expect(screen.getByText('Your Rights')).toBeInTheDocument()
expect(screen.getByText('Contact Us')).toBeInTheDocument()
expect(screen.getAllByText('Cookie Preferences')).toHaveLength(2) // body and footer
})
})
@@ -0,0 +1,18 @@
import React from 'react'
import Page from 'components/templates/Page/index.js'
import CookiePreferences from 'components/molecules/CookiePreferences/index.js'
import PrivacyPolicy from 'components/molecules/PrivacyPolicy/index.js'
import { Divider } from '@mui/material'
const PrivacyPage: React.FC = () => {
return (
<Page title="Privacy" showCookieConsent={false}>
<PrivacyPolicy />
<Divider sx={{ my: 4 }} />
<CookiePreferences />
</Page>
)
}
export default PrivacyPage