test: update insertContentTool spec to accept i18n error key

This commit is contained in:
Hannes Rudolph 2025-08-25 14:00:51 -06:00
parent b446b1d986
commit df697c0b9c

View file

@ -226,7 +226,13 @@ describe("insertContentTool", () => {
expect(mockedFsReadFile).not.toHaveBeenCalled()
expect(mockCline.consecutiveMistakeCount).toBe(1)
expect(mockCline.recordToolError).toHaveBeenCalledWith("insert_content")
expect(mockCline.say).toHaveBeenCalledWith("error", expect.stringContaining("non-existent file"))
// Accept both legacy hardcoded text and new i18n key-based message
expect(mockCline.say).toHaveBeenCalledWith(
"error",
expect.stringMatching(
/non-existent file|errors\.insertContentNewFile|tools:errors\.insertContentNewFile/,
),
)
expect(mockCline.diffViewProvider.update).not.toHaveBeenCalled()
expect(mockCline.diffViewProvider.pushToolWriteResult).not.toHaveBeenCalled()
})