/**
 * A6 regression: EventRepository route_prefix separator
 * Bug: route_prefix was joined with '.' but stored as '/'.
 * Fix: join with '/' to match storage format.
 */

import { describe, it, expect } from 'bun:test'
import { readFileSync } from 'fs'
import { join } from 'path'

describe('A6: EventRepository route prefix separator', () => {
  const src = readFileSync(
    join(import.meta.dir, '..', '..', 'src', 'storage', 'repositories', 'EventRepository.ts'),
    'utf-8'
  )

  it('joins route_prefix with / not .', () => {
    const match = src.match(/route_prefix\.join\(['"]([^'"]+)['"]\)/)
    expect(match).not.toBeNull()
    expect(match![1]).toBe('/')
  })

  it('does not join route_prefix with dot separator', () => {
    expect(src).not.toContain("route_prefix.join('.')")
  })
})
