import { describe, it, expect } from 'vitest';
import { createProgram } from '../src/index.js';

describe('createProgram', () => {
  it('creates a Commander program', () => {
    const program = createProgram();
    expect(program.name()).toBe('mcpctl');
  });

  it('has version flag', () => {
    const program = createProgram();
    expect(program.version()).toBe('0.0.1');
  });

  it('has config subcommand', () => {
    const program = createProgram();
    const config = program.commands.find((c) => c.name() === 'config');
    expect(config).toBeDefined();
  });

  it('has status subcommand', () => {
    const program = createProgram();
    const status = program.commands.find((c) => c.name() === 'status');
    expect(status).toBeDefined();
  });

  it('subcommands have output option', () => {
    const program = createProgram();
    const get = program.commands.find((c) => c.name() === 'get');
    const opt = get?.options.find((o) => o.long === '--output');
    expect(opt).toBeDefined();
  });

  it('has daemon-url option', () => {
    const program = createProgram();
    const opt = program.options.find((o) => o.long === '--daemon-url');
    expect(opt).toBeDefined();
  });
});
