|
|
@@ -424,7 +424,7 @@ describe("Cline", () => {
|
|
|
jest.spyOn(cline as any, "getEnvironmentDetails").mockResolvedValue("")
|
|
|
|
|
|
// Mock loadContext to return unmodified content.
|
|
|
- jest.spyOn(cline as any, "loadContext").mockImplementation(async (content) => [content, ""])
|
|
|
+ jest.spyOn(cline as any, "parseUserContent").mockImplementation(async (content) => [content, ""])
|
|
|
|
|
|
// Add test message to conversation history.
|
|
|
cline.apiConversationHistory = [
|
|
|
@@ -577,11 +577,8 @@ describe("Cline", () => {
|
|
|
// Mock environment details and context loading
|
|
|
jest.spyOn(clineWithImages as any, "getEnvironmentDetails").mockResolvedValue("")
|
|
|
jest.spyOn(clineWithoutImages as any, "getEnvironmentDetails").mockResolvedValue("")
|
|
|
- jest.spyOn(clineWithImages as any, "loadContext").mockImplementation(async (content) => [content, ""])
|
|
|
- jest.spyOn(clineWithoutImages as any, "loadContext").mockImplementation(async (content) => [
|
|
|
- content,
|
|
|
- "",
|
|
|
- ])
|
|
|
+ jest.spyOn(clineWithImages as any, "parseUserContent").mockImplementation(async (content) => content)
|
|
|
+ jest.spyOn(clineWithoutImages as any, "parseUserContent").mockImplementation(async (content) => content)
|
|
|
|
|
|
// Set up mock streams
|
|
|
const mockStreamWithImages = (async function* () {
|
|
|
@@ -885,7 +882,7 @@ describe("Cline", () => {
|
|
|
await task.catch(() => {})
|
|
|
})
|
|
|
|
|
|
- describe("loadContext", () => {
|
|
|
+ describe("parseUserContent", () => {
|
|
|
it("should process mentions in task and feedback tags", async () => {
|
|
|
const [cline, task] = Cline.create({
|
|
|
provider: mockProvider,
|
|
|
@@ -929,7 +926,7 @@ describe("Cline", () => {
|
|
|
]
|
|
|
|
|
|
// Process the content
|
|
|
- const [processedContent] = await cline["loadContext"](userContent)
|
|
|
+ const processedContent = await cline.parseUserContent(userContent)
|
|
|
|
|
|
// Regular text should not be processed
|
|
|
expect((processedContent[0] as Anthropic.TextBlockParam).text).toBe("Regular text with @/some/path")
|