test: remove low-value direct metadata-mapping unit case
This commit is contained in:
@@ -10,7 +10,6 @@ import {
|
||||
loadSessionStore,
|
||||
updateSessionStore,
|
||||
} from "../sessions.js";
|
||||
import { deriveSessionMetaPatch } from "./metadata.js";
|
||||
import {
|
||||
resolveSessionFilePath,
|
||||
resolveSessionTranscriptPathInDir,
|
||||
@@ -22,26 +21,6 @@ import {
|
||||
resolveMirroredTranscriptText,
|
||||
} from "./transcript.js";
|
||||
|
||||
describe("deriveSessionMetaPatch", () => {
|
||||
it("captures origin + group metadata", () => {
|
||||
const patch = deriveSessionMetaPatch({
|
||||
ctx: {
|
||||
Provider: "whatsapp",
|
||||
ChatType: "group",
|
||||
GroupSubject: "Family",
|
||||
From: "123@g.us",
|
||||
},
|
||||
sessionKey: "agent:main:whatsapp:group:123@g.us",
|
||||
});
|
||||
|
||||
expect(patch?.origin?.label).toBe("Family id:123@g.us");
|
||||
expect(patch?.origin?.provider).toBe("whatsapp");
|
||||
expect(patch?.subject).toBe("Family");
|
||||
expect(patch?.channel).toBe("whatsapp");
|
||||
expect(patch?.groupId).toBe("123@g.us");
|
||||
});
|
||||
});
|
||||
|
||||
describe("session path safety", () => {
|
||||
it("rejects unsafe session IDs", () => {
|
||||
expect(() => validateSessionId("../etc/passwd")).toThrow(/Invalid session ID/);
|
||||
|
||||
Reference in New Issue
Block a user