diff --git a/tests/strategies/chat/test_references.lua b/tests/strategies/chat/test_references.lua
index de6b30c7..cd5ab19b 100644
--- a/tests/strategies/chat/test_references.lua
+++ b/tests/strategies/chat/test_references.lua
@@ -206,4 +206,22 @@ T["References"]["Render"] = function()
h.eq(h.get_buf_lines(chat.bufnr), { "## foo", "", "> Sharing:", "> - pinned example", "", "" })
end
+T["References"]["can be cleared from messages"] = function()
+ chat.References:add({
+ id = "pinned example",
+ path = "tests.stubs.file.txt",
+ source = "tests.strategies.chat.slash_commands.basic",
+ opts = {
+ pinned = true,
+ },
+ })
+
+ local message = {
+ role = "user",
+ content = "> Sharing:\n> - pinned example\n\nHello, World",
+ }
+
+ h.eq("Hello, World", chat.References:clear(message).content)
+end
+
return T