fix frontend SVG results and downloads
This commit is contained in:
21
frontend/tests/a2a.test.mjs
Normal file
21
frontend/tests/a2a.test.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { unwrapSkillResponse } from "../src/a2a.js";
|
||||
|
||||
test("unwraps the production invoke response envelope", () => {
|
||||
const result = {
|
||||
status: "ok",
|
||||
svg_assets: [{ name: "sprite.svg", svg: "<svg></svg>" }],
|
||||
};
|
||||
|
||||
assert.deepEqual(
|
||||
unwrapSkillResponse({ result, events: [], artifacts: [], grant_id: null }),
|
||||
result,
|
||||
);
|
||||
});
|
||||
|
||||
test("keeps direct skill responses compatible", () => {
|
||||
const result = { status: "ok", receipts: [] };
|
||||
assert.equal(unwrapSkillResponse(result), result);
|
||||
});
|
||||
Reference in New Issue
Block a user