mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 16:25:50 +00:00
test: tighten directive tag assertions
This commit is contained in:
parent
91adcc68fe
commit
974fdc6bc0
1 changed files with 8 additions and 6 deletions
|
|
@ -216,9 +216,10 @@ describe("stripInlineDirectiveTagsFromMessageForDisplay", () => {
|
|||
content: [{ type: "text", text: "hello [[reply_to_current]] world [[audio_as_voice]]" }],
|
||||
};
|
||||
const result = stripInlineDirectiveTagsFromMessageForDisplay(input);
|
||||
expect(result).toMatchObject({
|
||||
content: [{ type: "text", text: "hello world " }],
|
||||
});
|
||||
if (!result) {
|
||||
throw new Error("expected stripped message");
|
||||
}
|
||||
expect(result.content).toEqual([{ type: "text", text: "hello world " }]);
|
||||
});
|
||||
|
||||
test("preserves empty-string text when directives are entire content", () => {
|
||||
|
|
@ -227,9 +228,10 @@ describe("stripInlineDirectiveTagsFromMessageForDisplay", () => {
|
|||
content: [{ type: "text", text: "[[reply_to_current]]" }],
|
||||
};
|
||||
const result = stripInlineDirectiveTagsFromMessageForDisplay(input);
|
||||
expect(result).toMatchObject({
|
||||
content: [{ type: "text", text: "" }],
|
||||
});
|
||||
if (!result) {
|
||||
throw new Error("expected stripped message");
|
||||
}
|
||||
expect(result.content).toEqual([{ type: "text", text: "" }]);
|
||||
});
|
||||
|
||||
test("returns original message when content is not an array", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue