- 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 <cursoragent@cursor.com>
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { mount } from '@vue/test-utils'
|
|
import { createRouter, createMemoryHistory } from 'vue-router'
|
|
import AppFooter from '@/components/AppFooter.vue'
|
|
|
|
function createTestRouter() {
|
|
return createRouter({
|
|
history: createMemoryHistory(),
|
|
routes: [
|
|
{
|
|
path: '/om-oss',
|
|
name: 'about',
|
|
component: { template: '<div>About</div>' },
|
|
},
|
|
{
|
|
path: '/om',
|
|
redirect: '/om-oss',
|
|
},
|
|
{
|
|
path: '/kontakt',
|
|
name: 'contact',
|
|
component: { template: '<div>Contact</div>' },
|
|
},
|
|
{
|
|
path: '/integritetspolicy',
|
|
name: 'privacy',
|
|
component: { template: '<div>Privacy</div>' },
|
|
},
|
|
{
|
|
path: '/villkor',
|
|
name: 'terms',
|
|
component: { template: '<div>Terms</div>' },
|
|
},
|
|
],
|
|
})
|
|
}
|
|
|
|
describe('AppFooter', () => {
|
|
it('renders all four links', () => {
|
|
const router = createTestRouter()
|
|
const wrapper = mount(AppFooter, {
|
|
global: { plugins: [router] },
|
|
})
|
|
const links = wrapper.findAll('a')
|
|
|
|
expect(links[0].text()).toBe('Om oss')
|
|
expect(links[0].attributes('href')).toBe('/om-oss')
|
|
|
|
expect(links[1].text()).toBe('Kontakt')
|
|
expect(links[1].attributes('href')).toBe('/kontakt')
|
|
|
|
expect(links[2].text()).toBe('Integritetspolicy')
|
|
expect(links[2].attributes('href')).toBe('/integritetspolicy')
|
|
|
|
expect(links[3].text()).toBe('Villkor')
|
|
expect(links[3].attributes('href')).toBe('/villkor')
|
|
})
|
|
})
|