// §22 three-tier — the canonical corpus path now carries the /c/<collection>/
// segment. These builders default to the project's `default` collection (S1).
import { describe, it, expect } from 'vitest'
import {
  entryPath, entryPrPath, proposalPath, collectionHome, projectHome, DEFAULT_COLLECTION,
} from './entryPaths.js'

describe('entryPaths — collection-scoped corpus URLs', () => {
  it('entryPath defaults to the default collection segment', () => {
    expect(entryPath('ohm', 'human')).toBe('/p/ohm/c/default/e/human')
  })

  it('entryPath honours an explicit collection id', () => {
    expect(entryPath('ohm', 'login', 'features')).toBe('/p/ohm/c/features/e/login')
  })

  it('entryPrPath carries the collection segment', () => {
    expect(entryPrPath('ohm', 'human', 7)).toBe('/p/ohm/c/default/e/human/pr/7')
  })

  it('proposalPath carries the collection segment', () => {
    expect(proposalPath('ohm', 42)).toBe('/p/ohm/c/default/proposals/42')
  })

  it('collectionHome targets the collection root', () => {
    expect(collectionHome('ohm')).toBe('/p/ohm/c/default/')
  })

  it('projectHome stays at the project root (redirects into the collection)', () => {
    expect(projectHome('ohm')).toBe('/p/ohm/')
  })

  it('exposes the default collection id constant', () => {
    expect(DEFAULT_COLLECTION).toBe('default')
  })
})
