From ec62ba7673aa449d6364734752fad5eb8e44c85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20M=C3=B6rling?= Date: Fri, 22 May 2026 13:51:20 +0200 Subject: [PATCH] =?UTF-8?q?Add=20anv=C3=A4ndarvillkor=20page=20for=20Bilhe?= =?UTF-8?q?j=20service=20terms.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create TermsOfServicePage covering Swish payment, letter content rules, and liability - Describe edit/cancel before payment and refund expectations after posting - Link to integritetspolicy and support contact in footer CTA - Add TermsOfServicePage unit tests Co-authored-by: Cursor --- .../src/__tests__/TermsOfServicePage.spec.ts | 58 ++++ frontend/src/pages/TermsOfServicePage.vue | 258 ++++++++++++++++++ 2 files changed, 316 insertions(+) create mode 100644 frontend/src/__tests__/TermsOfServicePage.spec.ts create mode 100644 frontend/src/pages/TermsOfServicePage.vue diff --git a/frontend/src/__tests__/TermsOfServicePage.spec.ts b/frontend/src/__tests__/TermsOfServicePage.spec.ts new file mode 100644 index 0000000..c21e0b2 --- /dev/null +++ b/frontend/src/__tests__/TermsOfServicePage.spec.ts @@ -0,0 +1,58 @@ +import { describe, it, expect } from 'vitest' +import { mount } from '@vue/test-utils' +import { createRouter, createMemoryHistory } from 'vue-router' +import TermsOfServicePage from '@/pages/TermsOfServicePage.vue' + +function createTestRouter() { + return createRouter({ + history: createMemoryHistory(), + routes: [ + { + path: '/villkor', + name: 'terms', + component: TermsOfServicePage, + }, + { + path: '/integritetspolicy', + name: 'privacy', + component: { template: '
Integritet
' }, + }, + { + path: '/kontakt', + name: 'contact', + component: { template: '
Kontakt
' }, + }, + ], + }) +} + +describe('TermsOfServicePage', () => { + it('renders title and lead', () => { + const router = createTestRouter() + const wrapper = mount(TermsOfServicePage, { + global: { plugins: [router] }, + }) + expect(wrapper.text()).toContain('Användarvillkor') + expect(wrapper.text()).toContain('49 kr') + }) + + it('describes payment and order rules', () => { + const router = createTestRouter() + const wrapper = mount(TermsOfServicePage, { + global: { plugins: [router] }, + }) + expect(wrapper.text()).toContain('Swish') + expect(wrapper.text()).toContain('Obetalda beställningar kan redigeras') + }) + + it('links to privacy policy and support email', () => { + const router = createTestRouter() + const wrapper = mount(TermsOfServicePage, { + global: { plugins: [router] }, + }) + expect(wrapper.find('a[href="/integritetspolicy"]').exists()).toBe(true) + expect(wrapper.find('a[href="mailto:support@bilhej.se"]').exists()).toBe( + true, + ) + }) +}) diff --git a/frontend/src/pages/TermsOfServicePage.vue b/frontend/src/pages/TermsOfServicePage.vue new file mode 100644 index 0000000..505eeb6 --- /dev/null +++ b/frontend/src/pages/TermsOfServicePage.vue @@ -0,0 +1,258 @@ + + + + +