Release God's Eye View as open source

This commit is contained in:
Bilawal Sidhu committed 2026-08-24 17:02:16 -05:00
1 parent a5aaea7e16
commit 880a672b5e
433 files changed
+219893 -23

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import test from 'node:test';
import {
COCKPIT_BRACKET_OPACITY,
detectionBracketOpacity,
} from './detectionPresentation.js';
test('Cockpit reduces only the bracket presentation multiplier', () => {
assert.equal(COCKPIT_BRACKET_OPACITY, 0.45);
assert.equal(detectionBracketOpacity(true), 0.45);
assert.equal(detectionBracketOpacity(false), 1);
assert.equal(detectionBracketOpacity(undefined), 1);
});
test('detection owns and releases the Cockpit lifecycle listener', async () => {
const source = await readFile(new URL('./detection.js', import.meta.url), 'utf8');
assert.match(source, /addEventListener\('gev:cockpit-mode-changed', _cockpitModeListener\)/);
assert.match(source, /removeEventListener\('gev:cockpit-mode-changed', _cockpitModeListener\)/);
assert.match(
source,
/fade \* entry\.alpha \* bracketPresentationOpacity/,
'Cockpit opacity must multiply bracket strokes only',
);
assert.doesNotMatch(
source,
/_drawCallout\(entry, fade \* bracketPresentationOpacity/,
'Cockpit bracket de-emphasis must not dim callouts',
);
});