mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 17:10:43 +00:00
test: tighten directive tag assertions
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user