Publish curated ITWorx-Pulse source from 0e0633c8ac91cb71312a26837f791035a78d81b8
Public source validation / validate (push) Failing after 2m10s

This commit is contained in:
Public Source Publisher committed 2026-09-30 01:14:48 +00:00
1 parent a4956c2af9
commit db8093b608
88 files changed
+3685 -469

No files matched your search

@@ -0,0 +1,40 @@
import { afterEach, describe, expect, it } from 'vitest';
import {
operatorCustomRangeValid,
operatorRangeSelection,
resetOperatorContextForTests,
setOperatorCustomRange,
setOperatorPaused,
setOperatorRangePreset,
} from '../../src/operatorContext';
afterEach(() => {
resetOperatorContextForTests();
window.localStorage.clear();
window.history.replaceState({}, '', '/');
});
describe('global operator context', () => {
it('encodes a valid custom range in the shareable URL', () => {
setOperatorCustomRange('2026-09-01T10:00', '2026-09-01T11:00');
const params = new URLSearchParams(window.location.search);
expect(params.get('range')).toBe('custom');
expect(params.get('from')).toBe(new Date('2026-09-01T10:00').toISOString());
expect(params.get('to')).toBe(new Date('2026-09-01T11:00').toISOString());
});
it('permits pause only for the live range', () => {
setOperatorRangePreset('live');
setOperatorPaused(true);
expect(window.localStorage.getItem('pulse.operator.paused')).toBe('true');
setOperatorRangePreset('1h');
expect(window.localStorage.getItem('pulse.operator.paused')).toBe('false');
});
it('fails closed to one hour when a custom range is invalid', () => {
const value = { range: 'custom' as const, customFrom: '2026-09-01T11:00', customTo: '2026-09-01T10:00', paused: false, refreshVersion: 0 };
expect(operatorCustomRangeValid(value)).toBe(false);
expect(operatorRangeSelection(value)).toBe('1h');
});
});