Publish ITWorx Pulse source
Public source validation / validate (push) Failing after 3m8s

This commit is contained in:
ITWorx Pulse release export
2026-09-03 02:09:19 +02:00
commit bd774932d5
614 changed files with 77116 additions and 0 deletions
@@ -0,0 +1,27 @@
import { describe, expect, it } from 'vitest';
import { containerSignalTone, signalToneFromState, sourceSignalTone, worstSignalTone } from '../../src/overviewSignals';
describe('overview signal semantics', () => {
it('fails source provenance closed when freshness is stale or unavailable', () => {
expect(sourceSignalTone({ state: 'healthy', freshness: 'stale' })).toBe('stale');
expect(sourceSignalTone({ state: 'healthy', freshness: 'unavailable' })).toBe('unknown');
expect(sourceSignalTone({ state: 'degraded', freshness: 'fresh' })).toBe('attention');
expect(sourceSignalTone({ state: 'healthy', freshness: 'fresh' })).toBe('healthy');
expect(sourceSignalTone(undefined)).toBe('unknown');
});
it('mirrors container domain state without escalating intentional stops', () => {
expect(containerSignalTone({ state: 'running', health: 'healthy' })).toBe('healthy');
expect(containerSignalTone({ state: 'running', health: 'unhealthy' })).toBe('attention');
expect(containerSignalTone({ state: 'restarting', health: 'unknown' })).toBe('attention');
expect(containerSignalTone({ state: 'stopped', health: 'unknown' })).toBe('critical');
expect(containerSignalTone({ state: 'stopped', health: 'unknown', intentionalStop: true })).toBe('unknown');
});
it('keeps the most severe state deterministically', () => {
expect(signalToneFromState('DOWN')).toBe('critical');
expect(worstSignalTone(['healthy', 'unknown', 'attention', 'stale'])).toBe('attention');
expect(worstSignalTone([])).toBe('unknown');
});
});