fix(ui): unify connectivity labels and move contour refresh to header
This commit is contained in:
@@ -33,7 +33,7 @@ test('actual registries determine node count and offline boards prevent all-onli
|
||||
const calls=installFetch(t);
|
||||
const snapshot=await readContourSnapshot(new AbortController().signal);
|
||||
assert.equal(snapshot.workers[0].contour.display_name,'Test compute');
|
||||
assert.deepEqual(contourSummary(snapshot),{tone:'warning',label:'Часть узлов не на связи',online:2,total:3});
|
||||
assert.deepEqual(contourSummary(snapshot),{tone:'warning',label:'Часть узлов не в сети',online:2,total:3});
|
||||
assert.equal(calls.length,4);
|
||||
});
|
||||
test('failed checks discard previous online data and distinguish unknown from empty',async t=>{
|
||||
@@ -54,5 +54,24 @@ test('invalid health never becomes reachable; identity mismatch and stale worker
|
||||
});
|
||||
test('an empty configured contour contains only the operator, with no fabricated worker',async t=>{
|
||||
installFetch(t,{data:{'/api/v1/system/contours':{schema_version:'missioncore.compute-contour-catalog/v1',contours:[]},'/api/v1/fleet':{items:[]}}});
|
||||
assert.deepEqual(contourSummary(await readContourSnapshot(new AbortController().signal)),{tone:'success',label:'Все узлы на связи',online:1,total:1});
|
||||
assert.deepEqual(contourSummary(await readContourSnapshot(new AbortController().signal)),{tone:'success',label:'Все узлы в сети',online:1,total:1});
|
||||
});
|
||||
|
||||
test('receiver failure leaves worker unknown instead of declaring it offline',async t=>{
|
||||
installFetch(t,{data:{'/api/v1/system/contours/test-compute/telemetry?history=90':{...worker,node:null,connection:{reachable:false,identity_matches:false,error_code:'telemetry-receiver-unavailable'}}}});
|
||||
const snapshot=await readContourSnapshot(new AbortController().signal);
|
||||
assert.equal(contourSummary(snapshot).label,'Состояние части узлов не подтверждено');
|
||||
const {workerConnectionStatus}=await server.ssrLoadModule('/src/core/system/workerConnectionStatus.ts');
|
||||
const status=workerConnectionStatus(snapshot.workers[0].telemetry);
|
||||
assert.equal(status.state,'unknown');
|
||||
assert.equal(status.label,'Не в сети');
|
||||
assert.equal(workerConnectionStatus({...worker,node:null,connection:{reachable:false,error_code:'telemetry-agent-stale'}}).label,'Не в сети');
|
||||
assert.equal(workerConnectionStatus(worker).state,'online');
|
||||
});
|
||||
|
||||
test('a responding Core with recording capacity pressure remains reachable',async t=>{
|
||||
installFetch(t,{data:{'/api/health':{...core,ok:false,components:{recording_cache:{status:'capacity-pressure'}}}}});
|
||||
const snapshot=await readContourSnapshot(new AbortController().signal);
|
||||
assert.equal(contourSummary(snapshot).online,2);
|
||||
assert.equal(contourSummary(snapshot).label,'Mission Core работает с ограничениями');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user