@@ -5,7 +5,6 @@ import type { MockedFunction } from "vitest"
55import { fileExistsAtPath , createDirectoriesForFile } from "../../../utils/fs"
66import { isPathOutsideWorkspace } from "../../../utils/pathUtils"
77import { getReadablePath } from "../../../utils/path"
8- import { unescapeHtmlEntities } from "../../../utils/text-normalization"
98import { everyLineHasLineNumbers , stripLineNumbers } from "../../../integrations/misc/extract-text"
109import { ToolUse , ToolResponse } from "../../../shared/tools"
1110import { writeToFileTool } from "../WriteToFileTool"
@@ -47,10 +46,6 @@ vi.mock("../../../utils/path", () => ({
4746 getReadablePath : vi . fn ( ) . mockReturnValue ( "test/path.txt" ) ,
4847} ) )
4948
50- vi . mock ( "../../../utils/text-normalization" , ( ) => ( {
51- unescapeHtmlEntities : vi . fn ( ) . mockImplementation ( ( content ) => content ) ,
52- } ) )
53-
5449vi . mock ( "../../../integrations/misc/extract-text" , ( ) => ( {
5550 everyLineHasLineNumbers : vi . fn ( ) . mockReturnValue ( false ) ,
5651 stripLineNumbers : vi . fn ( ) . mockImplementation ( ( content ) => content ) ,
@@ -97,7 +92,6 @@ describe("writeToFileTool", () => {
9792 const mockedCreateDirectoriesForFile = createDirectoriesForFile as MockedFunction < typeof createDirectoriesForFile >
9893 const mockedIsPathOutsideWorkspace = isPathOutsideWorkspace as MockedFunction < typeof isPathOutsideWorkspace >
9994 const mockedGetReadablePath = getReadablePath as MockedFunction < typeof getReadablePath >
100- const mockedUnescapeHtmlEntities = unescapeHtmlEntities as MockedFunction < typeof unescapeHtmlEntities >
10195 const mockedEveryLineHasLineNumbers = everyLineHasLineNumbers as MockedFunction < typeof everyLineHasLineNumbers >
10296 const mockedStripLineNumbers = stripLineNumbers as MockedFunction < typeof stripLineNumbers >
10397 const mockedPathResolve = path . resolve as MockedFunction < typeof path . resolve >
@@ -116,7 +110,6 @@ describe("writeToFileTool", () => {
116110 mockedFileExistsAtPath . mockResolvedValue ( false )
117111 mockedIsPathOutsideWorkspace . mockReturnValue ( false )
118112 mockedGetReadablePath . mockReturnValue ( "test/path.txt" )
119- mockedUnescapeHtmlEntities . mockImplementation ( ( content ) => content )
120113 mockedEveryLineHasLineNumbers . mockReturnValue ( false )
121114 mockedStripLineNumbers . mockImplementation ( ( content ) => content )
122115
@@ -322,22 +315,6 @@ describe("writeToFileTool", () => {
322315 expect ( mockCline . diffViewProvider . update ) . toHaveBeenCalledWith ( "" , true )
323316 } )
324317
325- it ( "unescapes HTML entities for non-Claude models" , async ( ) => {
326- mockCline . api . getModel . mockReturnValue ( { id : "gpt-4" } )
327-
328- await executeWriteFileTool ( { content : "<test>" } )
329-
330- expect ( mockedUnescapeHtmlEntities ) . toHaveBeenCalledWith ( "<test>" )
331- } )
332-
333- it ( "skips HTML unescaping for Claude models" , async ( ) => {
334- mockCline . api . getModel . mockReturnValue ( { id : "claude-3" } )
335-
336- await executeWriteFileTool ( { content : "<test>" } )
337-
338- expect ( mockedUnescapeHtmlEntities ) . not . toHaveBeenCalled ( )
339- } )
340-
341318 it ( "strips line numbers from numbered content" , async ( ) => {
342319 const contentWithLineNumbers = "1 | line one\n2 | line two"
343320 mockedEveryLineHasLineNumbers . mockReturnValue ( true )
0 commit comments