From 758ace1b9283875c3ada35e2ba3d5cb0b7f81735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20M=C3=B6rling?= Date: Fri, 22 May 2026 12:47:44 +0200 Subject: [PATCH] Redesign about page and move route to /om-oss. - Replace placeholder about card with hero, prose, steps, and CTA - Add primary route /om-oss with redirect from legacy /om - Update footer tagline and Om oss link to match new URL - Extend AboutPage and AppFooter tests for new content and routing Co-authored-by: Cursor --- frontend/src/__tests__/AboutPage.spec.ts | 38 +++- frontend/src/__tests__/AppFooter.spec.ts | 8 +- frontend/src/components/AppFooter.vue | 5 +- frontend/src/pages/AboutPage.vue | 224 +++++++++++++++++++++-- frontend/src/router/index.ts | 6 +- 5 files changed, 254 insertions(+), 27 deletions(-) diff --git a/frontend/src/__tests__/AboutPage.spec.ts b/frontend/src/__tests__/AboutPage.spec.ts index ac4ebd8..8563c1f 100644 --- a/frontend/src/__tests__/AboutPage.spec.ts +++ b/frontend/src/__tests__/AboutPage.spec.ts @@ -1,10 +1,44 @@ import { describe, it, expect } from 'vitest' import { mount } from '@vue/test-utils' +import { createRouter, createMemoryHistory } from 'vue-router' import AboutPage from '@/pages/AboutPage.vue' +function createTestRouter() { + return createRouter({ + history: createMemoryHistory(), + routes: [ + { path: '/om-oss', name: 'about', component: AboutPage }, + { path: '/', name: 'home', component: { template: '
Home
' } }, + ], + }) +} + describe('AboutPage', () => { - it('renders heading', () => { - const wrapper = mount(AboutPage) + it('renders heading and lead', () => { + const router = createTestRouter() + const wrapper = mount(AboutPage, { + global: { plugins: [router] }, + }) expect(wrapper.text()).toContain('Om Bilhej') + expect(wrapper.text()).toContain('Bilhej gör det enkelt') + }) + + it('renders how-it-works steps', () => { + const router = createTestRouter() + const wrapper = mount(AboutPage, { + global: { plugins: [router] }, + }) + expect(wrapper.text()).toContain('Skriv brevet här') + expect(wrapper.text()).toContain('Vi postar åt dig') + }) + + it('links to home page', () => { + const router = createTestRouter() + const wrapper = mount(AboutPage, { + global: { plugins: [router] }, + }) + const cta = wrapper.find('a.about__cta-btn') + expect(cta.exists()).toBe(true) + expect(cta.attributes('href')).toBe('/') }) }) diff --git a/frontend/src/__tests__/AppFooter.spec.ts b/frontend/src/__tests__/AppFooter.spec.ts index 42587d1..80f9b85 100644 --- a/frontend/src/__tests__/AppFooter.spec.ts +++ b/frontend/src/__tests__/AppFooter.spec.ts @@ -8,10 +8,14 @@ function createTestRouter() { history: createMemoryHistory(), routes: [ { - path: '/om', + path: '/om-oss', name: 'about', component: { template: '
About
' }, }, + { + path: '/om', + redirect: '/om-oss', + }, { path: '/kontakt', name: 'contact', @@ -40,7 +44,7 @@ describe('AppFooter', () => { const links = wrapper.findAll('a') expect(links[0].text()).toBe('Om oss') - expect(links[0].attributes('href')).toBe('/om') + expect(links[0].attributes('href')).toBe('/om-oss') expect(links[1].text()).toBe('Kontakt') expect(links[1].attributes('href')).toBe('/kontakt') diff --git a/frontend/src/components/AppFooter.vue b/frontend/src/components/AppFooter.vue index 0d11d4c..b83473f 100644 --- a/frontend/src/components/AppFooter.vue +++ b/frontend/src/components/AppFooter.vue @@ -6,11 +6,10 @@ import { RouterLink } from 'vue-router'