Files
agent-desk-ng/web/lib/message-file-identity.test.mjs
mono 2f7a491666 feat: harden support, localize knowledge and add operator availability [skip ci]
Source-only publication of reviewed commit 64e96a7f423673dc29ad56485be9fc79bce8af1c.

Passed in isolation: focused frontend/backend tests, race checks, TypeScript typecheck, lint, Go compilation, Flowgram build, and deterministic SDK build/tests.

Not accepted as a production release: Next.js export/native assembly remains blocked by environment memory limits; browser interaction and MySQL staging acceptance remain unverified. No production server, database/schema, runtime configuration, deployment, release tag, or workflow execution was performed.

Expected source tree: 0a4a7528e9.
2026-10-16 15:21:42 +00:00

15 lines
694 B
JavaScript

import assert from "node:assert/strict"
import test from "node:test"
import { getMessageFileIdentity } from "./message-file-identity.ts"
const file = (content, name = "attachment.txt") => ({ name, type: "text/plain",
arrayBuffer: async () => new TextEncoder().encode(content).buffer })
test("reselecting identical file content keeps attachment retry identity", async () => {
assert.equal(await getMessageFileIdentity(file("same")), await getMessageFileIdentity(file("same")))
})
test("equal-name equal-size files with different bytes cannot share retry identity", async () => {
assert.notEqual(await getMessageFileIdentity(file("left")), await getMessageFileIdentity(file("next")))
})