claude rework

This commit is contained in:
2026-06-07 15:43:43 +02:00
parent a2e2ff141e
commit b4874ad318
63 changed files with 5945 additions and 1752 deletions
+30
View File
@@ -0,0 +1,30 @@
import { describe, it, expect, beforeEach } from 'vitest'
import router from '../index'
describe('router auth guard', () => {
beforeEach(() => {
localStorage.clear()
})
it('redirects unauthenticated users away from protected routes', async () => {
await router.push('/feeds')
expect(router.currentRoute.value.name).toBe('login')
})
it('lets authenticated users reach protected routes', async () => {
localStorage.setItem('user-token', 'abc123')
await router.push('/feeds')
expect(router.currentRoute.value.name).toBe('feeds')
})
it('redirects the root path to the feeds route', async () => {
localStorage.setItem('user-token', 'abc123')
await router.push('/')
expect(router.currentRoute.value.name).toBe('feeds')
})
})