Files
stack/packages/webui/tests/library-status.test.mjs
jason.woltje 3315977095 row 254: library.sync 130 s human client timeout, six library-* STATUS entries, channel-proof re-pin, README (#1759)
Candidate megavolt/row254 b31300d79 on c3d88840c, manifest be63cfbe
(7 paths). Dewey APPROVE r1, rev 3006 (#1759 c30173). Gate on Sage's
slot by Megavolt, 23:37:27-23:40:52Z on b31300d79: library 77/77, bus
628/628, webui 305 pass with 1 skip (editor rebuild needs esbuild
0.28.2), every scripts/test-*.sh rc 0; the human-cli timeout and
library-fetch-failed STATUS mutants killed by their behaviour tests.
Landed onto 41b0cf755 with the candidate's blobs and modes for the 7
paths; c3d88840c..41b0cf755 touches none of them. Merged-tree rerun of
library, bus, webui and cli on Sage's slot before the push.
2026-10-21 18:44:22 -05:00

14 lines
687 B
JavaScript

// Row 254 (#1759): the library.sync refusal codes map to their HTTP status, not the 502 default.
import test from 'node:test';
import assert from 'node:assert/strict';
import { busStatus } from '../src/bus.mjs';
test('row 254: each library sync code maps to its status', () => {
const expected = {
'library-sync-busy': 409, 'library-diverged': 409, 'library-accept-stale': 409, 'library-accept-invalid': 400,
'library-credential-missing': 503, 'library-fetch-failed': 503,
};
for (const [code, status] of Object.entries(expected)) assert.equal(busStatus(code), status, code);
assert.equal(busStatus('library-not-a-code'), 502, 'an unknown code keeps the default');
});