diff --git a/frontend/src/__tests__/PrivacyPolicyPage.spec.ts b/frontend/src/__tests__/PrivacyPolicyPage.spec.ts new file mode 100644 index 0000000..f7f0d2c --- /dev/null +++ b/frontend/src/__tests__/PrivacyPolicyPage.spec.ts @@ -0,0 +1,54 @@ +import { describe, it, expect } from 'vitest' +import { mount } from '@vue/test-utils' +import { createRouter, createMemoryHistory } from 'vue-router' +import PrivacyPolicyPage from '@/pages/PrivacyPolicyPage.vue' + +function createTestRouter() { + return createRouter({ + history: createMemoryHistory(), + routes: [ + { + path: '/integritetspolicy', + name: 'privacy', + component: PrivacyPolicyPage, + }, + { + path: '/kontakt', + name: 'contact', + component: { template: '
Kontakt
' }, + }, + ], + }) +} + +describe('PrivacyPolicyPage', () => { + it('renders title and lead', () => { + const router = createTestRouter() + const wrapper = mount(PrivacyPolicyPage, { + global: { plugins: [router] }, + }) + expect(wrapper.text()).toContain('Integritetspolicy') + expect(wrapper.text()).toContain('personuppgifter') + }) + + it('describes sender and recipient data handling', () => { + const router = createTestRouter() + const wrapper = mount(PrivacyPolicyPage, { + global: { plugins: [router] }, + }) + expect(wrapper.text()).toContain('Mottagarens postadress') + expect(wrapper.text()).toContain('sparas inte efter utskick') + expect(wrapper.text()).toContain('varken vi eller obehöriga') + }) + + it('links to contact email and contact page', () => { + const router = createTestRouter() + const wrapper = mount(PrivacyPolicyPage, { + global: { plugins: [router] }, + }) + expect(wrapper.find('a[href="mailto:kontakt@bilhej.se"]').exists()).toBe( + true, + ) + expect(wrapper.find('a.policy__link').attributes('href')).toBe('/kontakt') + }) +}) diff --git a/frontend/src/pages/PrivacyPolicyPage.vue b/frontend/src/pages/PrivacyPolicyPage.vue new file mode 100644 index 0000000..07228b4 --- /dev/null +++ b/frontend/src/pages/PrivacyPolicyPage.vue @@ -0,0 +1,239 @@ + + + + +