import { describe, expect, it } from 'vitest';
import { getSetupStatus } from './setupStatus';
import { mockServerConfig } from '../test/fixtures';

describe('getSetupStatus', () => {
  it('flags empty wallet and blank public URL', () => {
    const status = getSetupStatus(
      mockServerConfig({ wallet: { address: '' }, server: { public_url: '' } })
    );
    expect(status.needsCalibration).toBe(true);
    expect(status.reasons.length).toBeGreaterThanOrEqual(2);
  });

  it('passes when wallet and LAN URL are set', () => {
    const status = getSetupStatus(
      mockServerConfig({
        wallet: {
          address:
            '4' + 'A'.repeat(94),
        },
        server: { public_url: 'http://192.168.1.5:8989' },
      })
    );
    expect(status.needsCalibration).toBe(false);
  });
});
