import test from 'node:test'
import assert from 'node:assert/strict'

import { chooseRuntimePreset } from './aipros-auto-start.mjs'

test('chooseRuntimePreset prefers codex when multiple classroom CLIs are installed', () => {
  const preset = chooseRuntimePreset(command => ['qoder', 'codex', 'trae'].includes(command))
  assert.equal(preset.code, 'codex')
})

test('chooseRuntimePreset returns null when no supported local AI CLI is installed', () => {
  const preset = chooseRuntimePreset(() => false)
  assert.equal(preset, null)
})
