"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const autostart_1 = require("../walls/07-runtime/setup/autostart");
describe('Autostart — Windows Startup launcher', () => {
    it('getCellCliPath returns path to cell.js', () => {
        const p = (0, autostart_1.getCellCliPath)();
        expect(p).toContain('cell.js');
    });
    it('getAutostartCommand includes --from-autostart', () => {
        const cmd = (0, autostart_1.getAutostartCommand)({ nodePath: '/usr/bin/node', cliPath: '/tmp/cli.js' });
        expect(cmd).toContain('--from-autostart');
        expect(cmd).toContain('/usr/bin/node');
        expect(cmd).toContain('/tmp/cli.js');
    });
    it('getWindowsStartupPath points to Startup folder', () => {
        const p = (0, autostart_1.getWindowsStartupPath)();
        expect(p).toContain('Startup');
        expect(p).toContain('FivoCellDaemon.cmd');
    });
    it('on non-win32, registerAutostart returns skipped', () => {
        const result = (0, autostart_1.registerAutostart)({ platform: 'linux' });
        expect(result.ok).toBe(true);
        expect(result.skipped).toBe(true);
        expect(result.message).toContain('Windows');
    });
    it('on non-win32, unregisterAutostart returns skipped', () => {
        const result = (0, autostart_1.unregisterAutostart)({ platform: 'darwin' });
        expect(result.ok).toBe(true);
        expect(result.skipped).toBe(true);
    });
    it('on non-win32, checkAutostart returns skipped', () => {
        const result = (0, autostart_1.checkAutostart)({ platform: 'linux' });
        expect(result.ok).toBe(true);
        expect(result.skipped).toBe(true);
    });
    it('dryRun mode returns skipped without writing Startup launcher', () => {
        const result = (0, autostart_1.registerAutostart)({ platform: 'win32', dryRun: true });
        expect(result.ok).toBe(true);
        expect(result.skipped).toBe(true);
        expect(result.message).toContain('Would register');
    });
    it('dryRun unregister returns skipped', () => {
        const result = (0, autostart_1.unregisterAutostart)({ platform: 'win32', dryRun: true });
        expect(result.ok).toBe(true);
        expect(result.skipped).toBe(true);
        expect(result.message).toContain('Would remove');
    });
    it('CELL_AUTOSTART_TASK constant is set', () => {
        expect(autostart_1.CELL_AUTOSTART_TASK).toBe('FivoCellDaemon');
    });
});
//# sourceMappingURL=autostart.test.js.map