mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
Frame the port-drawn gizmo in the CCTV QA drag fixture and share the catalog-pair reader
The drag-fixture framing looked the gizmo up in viewer.entities, which main no longer populates, so it did nothing and five drag checks stayed inconclusive. It now reads the arrow from the layer's drawn state and records the framed shaft length as a check. Tarktee and Lithuania read their two catalogs through one helper, readCatalogsTogether, so both get the shared deadline, sibling abort and the release of a response that arrives after the other feed failed. An Ontario error response has its body released, and tests pin the refused redirect and system-code log labels.
This commit is contained in:
1 parent
bdd92663d6
commit
75f1a3c181
9 files changed
+160
-92
No files matched your search
@@ -167,3 +167,55 @@ test('Ontario encodes reserved key characters and refuses credential-bearing red
|
||||
assert.equal(JSON.stringify(cameras).includes('synthetic'), false);
|
||||
assert.equal(lines.join(' ').includes('synthetic'), false);
|
||||
});
|
||||
|
||||
test('Ontario names a refused redirect and a system code without the request text', async (t) => {
|
||||
const lines = captureConsole(t);
|
||||
const key = 'synthetic-secret';
|
||||
const failures = [
|
||||
// The shape Node's fetch gives a refused redirect and a DNS failure.
|
||||
new TypeError('fetch failed', {
|
||||
cause: new Error('unexpected redirect'),
|
||||
}),
|
||||
new TypeError('fetch failed', {
|
||||
cause: Object.assign(new Error(`getaddrinfo ENOTFOUND ${key}`), {
|
||||
code: 'ENOTFOUND',
|
||||
}),
|
||||
}),
|
||||
];
|
||||
t.mock.method(globalThis, 'fetch', async () => {
|
||||
throw failures.shift();
|
||||
});
|
||||
for (let i = 0; i < 2; i++) {
|
||||
assert.deepEqual(
|
||||
await loadOntarioSourcesFromOpenData({}, { ONTARIO_511_API_KEY: key }),
|
||||
[],
|
||||
);
|
||||
}
|
||||
assert.deepEqual(lines, [
|
||||
'[CCTV] Ontario 511 camera download error (TypeError, redirect refused)',
|
||||
'[CCTV] Ontario 511 camera download error (TypeError ENOTFOUND)',
|
||||
]);
|
||||
});
|
||||
|
||||
test('Ontario releases the body of an error response', async (t) => {
|
||||
captureConsole(t);
|
||||
let cancelled = false;
|
||||
t.mock.method(
|
||||
globalThis,
|
||||
'fetch',
|
||||
async () =>
|
||||
new Response(
|
||||
new ReadableStream({
|
||||
cancel() {
|
||||
cancelled = true;
|
||||
},
|
||||
}),
|
||||
{ status: 503 },
|
||||
),
|
||||
);
|
||||
assert.deepEqual(
|
||||
await loadOntarioSourcesFromOpenData({}, { ONTARIO_511_API_KEY: 'k' }),
|
||||
[],
|
||||
);
|
||||
assert.equal(cancelled, true);
|
||||
});
|
||||
Reference in new issue
Block a user