Polish Deploy Recon page scan UX and Crucible cross-links.
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
This commit is contained in:
@@ -36,6 +36,19 @@ vi.mock('../hooks/useFleetGroups', () => ({
|
||||
vi.mock('../api/client', () => ({
|
||||
api: {
|
||||
sendAgentCommand: vi.fn().mockResolvedValue({ success: true }),
|
||||
getReconDeployKit: vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
host: '10.1.2.99',
|
||||
join_lane: 'winrm',
|
||||
dropper_urls: { install_sh: 'https://deck/install.sh' },
|
||||
}),
|
||||
postFleetSpreadToHost: vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
host: '10.1.2.99',
|
||||
recommended_command: 'discover_and_join',
|
||||
operator_note: 'seed from lan-1',
|
||||
seed_agent_id: 'seed-1',
|
||||
}),
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -75,6 +88,10 @@ vi.mock('../components/Fleet/FullSysCheckPanel', () => ({
|
||||
default: () => null,
|
||||
}));
|
||||
|
||||
vi.mock('../components/Fleet/AccessDepthPanel', () => ({
|
||||
default: () => null,
|
||||
}));
|
||||
|
||||
vi.mock('../components/HelpTip', () => ({
|
||||
HelpTip: () => null,
|
||||
}));
|
||||
@@ -304,6 +321,25 @@ describe('CruciblePage terminal — command_result processing', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('CruciblePage reconHost query', () => {
|
||||
beforeEach(() => vi.clearAllMocks());
|
||||
afterEach(() => cleanup());
|
||||
|
||||
it('shows unreachable host spread panel when reconHost has no online agent', async () => {
|
||||
const offline = mockAgent({ id: 'off-1', name: 'ghost', ip: '10.1.2.99', status: 'offline' });
|
||||
useWebSocketMock.mockReturnValue(makeWsValue({ agents: [offline] }) as ReturnType<typeof useWebSocket>);
|
||||
render(
|
||||
<MemoryRouter initialEntries={['/crucible?reconHost=10.1.2.99&tab=spread']}>
|
||||
<CruciblePage />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText(/Spread to unreachable host/i)).toBeInTheDocument();
|
||||
});
|
||||
expect(screen.getByDisplayValue('10.1.2.99')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
// ── Helper function tests ─────────────────────────────────────────────────
|
||||
|
||||
describe('CruciblePage helpers', () => {
|
||||
|
||||
Reference in New Issue
Block a user