unrip/test/ops-sentinel-static.test.mjs
philipp 601450c664
Some checks failed
deploy / deploy (push) Failing after 29s
Persist NEAR status changes only
Proof: npm test; npm run operator-dashboard:build; node --test test/near-intents-status.test.mjs test/environment-status-history.test.mjs test/operator-dashboard.test.mjs test/operator-dashboard-ui-static.test.mjs test/ops-sentinel-static.test.mjs; PYTHONPATH=. python3 test/repo_deployments_test.py; kubectl kustomize deploy/k8s/base.

Assumptions: NEAR Intents public status page API remains the official upstream environmental-status source; status fingerprint changes are the durable boundary for saving environmental history.

Still fake: This stores and displays official upstream status changes, but it does not create an alternate quote source or make NEAR quoting operational during an upstream pause.
2026-04-17 14:34:10 +02:00

22 lines
966 B
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const source = readFileSync(new URL('../src/apps/ops-sentinel.mjs', import.meta.url), 'utf8');
test('ops sentinel imports executor containment guard used by runtime evaluation', () => {
assert.match(source, /shouldContainExecutorForAlerts\(alerts\)/);
assert.match(
source,
/import\s*\{[\s\S]*shouldContainExecutorForAlerts[\s\S]*\}\s*from\s*'\.\.\/core\/runtime-health\.mjs';/,
);
});
test('ops sentinel polls official NEAR status and publishes environment status without alerting', () => {
assert.match(source, /pollNearIntentsEnvironmentStatus/);
assert.match(source, /kafkaTopicOpsEnvironmentStatus/);
assert.match(source, /buildNearIntentsStatusEventPayload/);
assert.match(source, /normalized\.status_fingerprint === state\.last_environment_status_fingerprint/);
assert.match(source, /assertEnvironmentStatusEvent/);
});