feat: add control panel
This commit is contained in:
@@ -47,6 +47,30 @@ test('security()/governance()/cost() return objects with expected keys', () => {
|
||||
assert.ok('provider_tokens' in (svc.cost() as any));
|
||||
});
|
||||
|
||||
test('commandCenter() returns evidence-backed widget contract', () => {
|
||||
const svc = new TelemetryService();
|
||||
const command = svc.commandCenter() as any;
|
||||
const ids = Object.keys(command.widgets);
|
||||
assert.deepEqual(ids.sort(), [
|
||||
'certification',
|
||||
'finops',
|
||||
'hitl',
|
||||
'kill_switch',
|
||||
'maturity',
|
||||
'security',
|
||||
'self_improve',
|
||||
'traceability',
|
||||
]);
|
||||
for (const w of Object.values(command.widgets) as any[]) {
|
||||
assert.ok(w.id && w.title && w.status);
|
||||
assert.ok(w.envelope && typeof w.envelope.artifact_path === 'string');
|
||||
assert.ok(['verified', 'present_unverified', 'missing'].includes(w.envelope.status));
|
||||
assert.equal(typeof w.envelope.verified, 'boolean');
|
||||
}
|
||||
assert.ok(Array.isArray(command.briefing));
|
||||
assert.ok(Array.isArray(command.ticker));
|
||||
});
|
||||
|
||||
test('freshness helpers behave (age is number|null, isStale is boolean)', () => {
|
||||
const age = metricsAgeSeconds();
|
||||
assert.ok(age === null || typeof age === 'number');
|
||||
|
||||
Reference in New Issue
Block a user