import { OfficeCliService } from './office-cli.service';

describe('OfficeCliService', () => {
  it('prefers the npm-bundled binary when @officecli/officecli is installed', async () => {
    const service = new OfficeCliService();
    const resolveBinary = (
      service as unknown as { resolveBinary(): Promise<string> }
    ).resolveBinary.bind(service);
    const resolved = await resolveBinary();
    expect(resolved).toContain('@officecli/officecli');
  });

  it('returns structured results from a real view call', async () => {
    const service = new OfficeCliService();
    const result = await service.view(process.execPath, 'outline');
    expect(result).toHaveProperty('success');
    expect(typeof result.success).toBe('boolean');
  });
});
