Skip to content

Commit a721f83

Browse files
committed
WIP tests
1 parent c83c2ac commit a721f83

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/__tests__/TempOverrideIntegration.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ describe("Temperature Override Integration", () => {
102102
// Mock console.error to reduce test noise
103103
jest.spyOn(console, "error").mockImplementation(() => {})
104104

105-
// Create mock API with options property
105+
// Create mock API with options property and required methods
106106
mockApi = {
107107
options: {
108108
modelTemperature: defaultTemp,
109109
},
110+
getModel: jest.fn().mockReturnValue("test-model"),
111+
setTemperature: jest.fn(),
110112
}
111113

112114
cline = new Cline({
@@ -151,6 +153,8 @@ describe("Temperature Override Integration", () => {
151153

152154
expect(cline.apiConfiguration.modelTemperature).toBe(defaultTemp)
153155
expect(userContent[0].text).toBe("@customTemperature:0.9 Do something")
156+
expect(mockApi.getModel).toHaveBeenCalled()
157+
expect(mockApi.setTemperature).not.toHaveBeenCalled()
154158
})
155159

156160
it("should apply temperature override when enabled", async () => {
@@ -167,6 +171,8 @@ describe("Temperature Override Integration", () => {
167171
expect(cline.apiConfiguration.modelTemperature).toBe(0.9) // Should be set to the override value
168172
expect(userContent[0].text).toBe(" Do something") // Should preserve leading space like real service
169173
expect(mockGetConfig).toHaveBeenCalledWith("enableTemperatureOverride", true)
174+
expect(mockApi.getModel).toHaveBeenCalled()
175+
expect(mockApi.setTemperature).toHaveBeenCalledWith(0.9)
170176
})
171177

172178
it("should handle invalid temperature override gracefully", async () => {

0 commit comments

Comments
 (0)