import { describe, expect, it } from 'vitest'
import { canAccessRoute } from '../routeAccess'

describe('route access contract', () => {
  it('allows routes without a declared permission', () => {
    expect(canAccessRoute({}, new Set())).toBe(true)
  })

  it('requires every declared permission', () => {
    expect(canAccessRoute({ permissions: ['model.read'] }, new Set())).toBe(false)
    expect(canAccessRoute({ permissions: ['model.read'] }, new Set(['model.read']))).toBe(true)
  })
})
