Add store header OCR and market observation outbox
This commit is contained in:
@@ -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);
|
||||
});
|
||||
Reference in New Issue
Block a user