import fs from 'node:fs'
import path from 'node:path'

import { describe, expect, it } from 'vitest'

const repoRoot = '/home/intlc/projects/Sankofa'

describe('public route integrity', () => {
  it('keeps legacy portal compatibility routes in place', () => {
    const expectedFiles = [
      'src/app/portal/page.tsx',
      'src/app/portal/[...slug]/page.tsx',
      'src/app/portal/signin/page.tsx',
      'src/app/portal/admin/page.tsx',
      'src/app/portal/partners/page.tsx',
      'src/app/portal/callback/page.tsx',
    ]

    for (const relativePath of expectedFiles) {
      expect(fs.existsSync(path.join(repoRoot, relativePath))).toBe(true)
    }
  })

  it('provides concrete destinations for high-traffic public links', () => {
    const expectedFiles = [
      'src/app/solutions/sovereignty/page.tsx',
      'src/app/partners/benefits/page.tsx',
      'src/app/marketplace/page.tsx',
    ]

    for (const relativePath of expectedFiles) {
      expect(fs.existsSync(path.join(repoRoot, relativePath))).toBe(true)
    }
  })
})
