Implement bounded Windows Event Log jobs and verify contracts on cloud Linux
Rust development slice / linux (push) Failing after 7s
Rust development slice / linux (push) Failing after 7s
This commit is contained in:
@@ -5,6 +5,18 @@ import { sha256, verifyPlanIntegrity } from './safety';
|
||||
// Import the actual renderer without mounting the application's network effects.
|
||||
vi.mock('react-dom/client', () => ({ createRoot: () => ({ render: vi.fn() }) }));
|
||||
|
||||
it('shows fixed Event Log source, half-open UTC window and both runtime bounds before approval', async () => {
|
||||
const fetch=vi.fn();vi.stubGlobal('fetch',fetch);vi.stubGlobal('document',{getElementById:()=>({})});
|
||||
try{
|
||||
const {QueryLogsPlanNotice}=await import('./main');
|
||||
const payload={jobs:[{payload:{asset_id:'win-fixture',execution_identity:'agent_service',max_runtime_seconds:30,max_output_bytes:4096,action:{action:'query_logs',unit:'windows.eventlog.application.rustdiscovery-mvp-test',since:'2026-11-14T00:00:00Z',until:'2026-11-14T01:00:00Z',max_lines:1000}}}]};
|
||||
const raw=new TextEncoder().encode(JSON.stringify(payload)),plan={plan_payload_bytes:Array.from(raw),plan_hash:await sha256(raw),plan_payload:payload};
|
||||
expect(renderToStaticMarkup(<QueryLogsPlanNotice plan={plan}/>)).toContain('role="alert"');await verifyPlanIntegrity(plan);
|
||||
const html=renderToStaticMarkup(<QueryLogsPlanNotice plan={plan}/>);for(const expected of ['Application','RustDiscovery-MVP-Test','1000','4096','30s','5000ms','kooperativ','2026-11-14T01:00:00Z)','Keine Bookmark'])expect(html).toContain(expected);
|
||||
expect(html).not.toMatch(/<(button|input|form)\b/);expect(fetch).not.toHaveBeenCalled();
|
||||
}finally{vi.unstubAllGlobals();}
|
||||
});
|
||||
|
||||
it('shows the verified PowerShell process profile before approval without issuing requests', async () => {
|
||||
const fetch = vi.fn(); vi.stubGlobal('fetch', fetch); vi.stubGlobal('document', { getElementById: () => ({}) });
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user