mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Complete phase 3 W1 acceptance and close T16 findings
Fix Navara model display tint, overlay ordering, follow gestures and resource cleanup. Reduce repeated aircraft work and correct fixture enrichment responses. Strengthen dev/preview QA, preserve failure history and document verified W1 results. Validation: 7171 ordinary tests pass, one Windows-only skip; 15 allocation probes; 37 W1 acceptance steps; contracts, shell, four performance gates; 18 identical Cesium baseline PNGs. Known pre-existing CCTV and live-source limits are recorded.
This commit is contained in:
1 parent
766c786093
commit
0600964249
59 files changed
+2334
-701
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { runInNewContext } from 'node:vm';
|
||||
|
||||
import {
|
||||
DEFAULT_DATA_MODE,
|
||||
@@ -7,6 +8,8 @@ import {
|
||||
isHardwareRenderer,
|
||||
isHeadfulMode,
|
||||
parseDataMode,
|
||||
vesselCardCaptureUrl,
|
||||
installSyntheticVesselFeed,
|
||||
vesselCardManifestFilename,
|
||||
vesselCardProvenanceLines,
|
||||
vesselCardScreenshotFilename,
|
||||
@@ -89,3 +92,80 @@ test('vessel-card QA distinguishes hardware evidence from software rendering', (
|
||||
assert.equal(isHardwareRenderer({ vendor: 'Google Inc.', renderer: 'ANGLE (SwiftShader)' }), false);
|
||||
assert.equal(isHardwareRenderer({ vendor: 'unavailable', renderer: 'unavailable' }), false);
|
||||
});
|
||||
|
||||
test('synthetic card URL removes competing qaFeed while live mode preserves it', () => {
|
||||
const input =
|
||||
'http://127.0.0.1:4193/?engine=navara&qaFeed=vessels:fixture#v=2';
|
||||
const synthetic = new URL(vesselCardCaptureUrl(input, 'synthetic'));
|
||||
assert.equal(synthetic.searchParams.has('qaFeed'), false);
|
||||
assert.equal(synthetic.searchParams.get('engine'), 'navara');
|
||||
assert.equal(synthetic.hash, '#v=2');
|
||||
assert.equal(
|
||||
new URL(vesselCardCaptureUrl(input, 'live')).searchParams.get('qaFeed'),
|
||||
'vessels:fixture',
|
||||
);
|
||||
});
|
||||
|
||||
function fixtureWindow() {
|
||||
const rows = [{ mmsi: '990100000', lat: 51.95, lon: 4.1, name: 'QA' }];
|
||||
const clock = { nowMs: 1000 };
|
||||
const calls = [];
|
||||
const window = {
|
||||
fetch: (...args) => {
|
||||
calls.push(args);
|
||||
return Promise.resolve('passthrough');
|
||||
},
|
||||
};
|
||||
runInNewContext(`(${installSyntheticVesselFeed.toString()})(rows)`, {
|
||||
rows,
|
||||
window,
|
||||
location: {
|
||||
href: 'http://127.0.0.1:4193/',
|
||||
origin: 'http://127.0.0.1:4193',
|
||||
},
|
||||
URL,
|
||||
Response,
|
||||
Date: { now: () => clock.nowMs },
|
||||
});
|
||||
return { rows, clock, calls, window };
|
||||
}
|
||||
|
||||
test('a late vessel refresh retains the exact card fixture with fresh receipt stamps', async () => {
|
||||
const { window, rows, clock, calls } = fixtureWindow();
|
||||
const first = await (await window.fetch('/api/vessels?lat=51.95')).json();
|
||||
clock.nowMs = 5000;
|
||||
const late = await (
|
||||
await window.fetch(
|
||||
new Request('http://127.0.0.1:4193/api/vessels?lat=29.7'),
|
||||
)
|
||||
).json();
|
||||
assert.deepEqual(
|
||||
first.rows.map((row) => row.mmsi),
|
||||
['990100000'],
|
||||
);
|
||||
assert.deepEqual(
|
||||
late.rows.map((row) => row.mmsi),
|
||||
['990100000'],
|
||||
);
|
||||
assert.equal(late.newestPositionAt, 5000);
|
||||
assert.equal(late.rows[0].last_position_epoch, 5);
|
||||
const urlInput = await (
|
||||
await window.fetch(new URL('http://127.0.0.1:4193/api/vessels'))
|
||||
).json();
|
||||
assert.deepEqual(
|
||||
urlInput.rows.map((row) => row.mmsi),
|
||||
['990100000'],
|
||||
);
|
||||
assert.equal(rows[0].last_position_epoch, undefined);
|
||||
assert.equal(calls.length, 0);
|
||||
});
|
||||
|
||||
test('the card fixture leaves other paths and external origins to the original fetch', async () => {
|
||||
const { window, calls } = fixtureWindow();
|
||||
assert.equal(await window.fetch('/api/vessels/track'), 'passthrough');
|
||||
assert.equal(
|
||||
await window.fetch('https://example.invalid/api/vessels'),
|
||||
'passthrough',
|
||||
);
|
||||
assert.equal(calls.length, 2);
|
||||
});
|
||||
Reference in new issue
Block a user