import assert from 'node:assert/strict' import fs from 'node:fs' import path from 'node:path' import test from 'node:test' const repoRoot = path.resolve(import.meta.dirname, '../..') const read = relative => fs.readFileSync(path.join(repoRoot, relative), 'utf8') test('frontend auth foundation exposes a public login route and guarded workspace', () => { const router = read('frontend/src/router/index.js') const authStore = read('frontend/src/stores/auth.js') const loginView = read('frontend/src/views/LoginView.vue') assert.match(router, /path:\s*['"]\/login['"]/) assert.match(router, /name:\s*['"]Login['"]/) assert.match(router, /beforeEach/) assert.match(router, /requiresAuth/) assert.match(authStore, /api\/auth\/login|auth\/login/) assert.doesNotMatch(authStore, /localStorage\.(setItem|save).*token/i) assert.match(loginView, /auth\.login|login\(/) assert.match(loginView, /name:\s*['"]Login['"]|router\.(push|replace)/) })