Add store header OCR and market observation outbox

This commit is contained in:
2026-08-11 17:29:41 +03:00
parent d6e0ba466b
commit f87a65bb04
13 changed files with 1110 additions and 182 deletions
+21
View File
@@ -0,0 +1,21 @@
import assert from "node:assert/strict";
import test from "node:test";
import { forwardMarketBatch } from "../vite.config.js";
test("keeps the import token in the local server-side forwarder", async () => {
let forwarded;
const response = await forwardMarketBatch('{"batchId":"one"}', {
url: "https://l2.example/api/l2/market/import",
token: "secret",
fetchImpl: async (url, init) => {
forwarded = { url, init };
return Response.json({ imported: true });
},
});
assert.equal(response.status, 200);
assert.equal(forwarded.url, "https://l2.example/api/l2/market/import");
assert.equal(forwarded.init.headers.Authorization, "Bearer secret");
assert.equal(forwarded.init.body, '{"batchId":"one"}');
assert.equal((await forwardMarketBatch("{}", {})).status, 503);
});