Files
AetherForge/server/web/src/help/forgeSmartDefaults.test.ts
drjones c95a4373de Add forge pipeline polish, simple forge UX, and fleet management upgrades.
Fusion copies prep icon and version info via go-winres; optional Garble obfuscation, Authenticode signing, and dry-run size estimates. Forge Simple mode with smart defaults; fleet roster gets compact expandable cards, filters, bulk commands, per-agent notes/tags, and typed WebSocket payloads.
2026-05-28 21:48:20 -07:00

27 lines
967 B
TypeScript

import { describe, expect, it } from 'vitest';
import { pickBestServerUrl, suggestWorkerName, applySmartForgeDefaults } from './forgeSmartDefaults';
import type { BuildRequest } from '../types';
describe('forgeSmartDefaults', () => {
it('suggests next worker-N name', () => {
expect(suggestWorkerName([{ worker_name: 'worker-1' } as any])).toBe('worker-2');
});
it('picks LAN url over localhost', () => {
expect(
pickBestServerUrl('http://localhost:8989', ['http://192.168.1.5:8989'])
).toBe('http://192.168.1.5:8989');
});
it('fills worker and process name', () => {
const form = applySmartForgeDefaults(
{ worker_name: '', server_url: '' } as BuildRequest,
{ endpointCandidates: ['http://10.0.0.2:8989'] }
);
expect(form.worker_name).toMatch(/^worker-/);
expect(form.process_name).toBeTruthy();
expect(form.server_url).toBe('http://10.0.0.2:8989');
expect(form.mining_mode).toBe('idle');
});
});