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.
27 lines
967 B
TypeScript
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');
|
|
});
|
|
});
|