mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Fix test (#2607)
This commit is contained in:
parent
929503a4c8
commit
ab7ca17f29
2 changed files with 14 additions and 9 deletions
5
.changeset/purple-oranges-eat.md
Normal file
5
.changeset/purple-oranges-eat.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"roo-cline": patch
|
||||
---
|
||||
|
||||
v3.11.16
|
||||
|
|
@ -76,7 +76,7 @@ describe("OpenAiNativeHandler", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
mockOptions = {
|
||||
apiModelId: "gpt-4o",
|
||||
apiModelId: "gpt-4.1",
|
||||
openAiNativeApiKey: "test-api-key",
|
||||
}
|
||||
handler = new OpenAiNativeHandler(mockOptions)
|
||||
|
|
@ -91,7 +91,7 @@ describe("OpenAiNativeHandler", () => {
|
|||
|
||||
it("should initialize with empty API key", () => {
|
||||
const handlerWithoutKey = new OpenAiNativeHandler({
|
||||
apiModelId: "gpt-4o",
|
||||
apiModelId: "gpt-4.1",
|
||||
openAiNativeApiKey: "",
|
||||
})
|
||||
expect(handlerWithoutKey).toBeInstanceOf(OpenAiNativeHandler)
|
||||
|
|
@ -196,7 +196,7 @@ describe("OpenAiNativeHandler", () => {
|
|||
beforeEach(() => {
|
||||
handler = new OpenAiNativeHandler({
|
||||
...mockOptions,
|
||||
apiModelId: "gpt-4o",
|
||||
apiModelId: "gpt-4.1",
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ describe("OpenAiNativeHandler", () => {
|
|||
])
|
||||
|
||||
expect(mockCreate).toHaveBeenCalledWith({
|
||||
model: "gpt-4o",
|
||||
model: "gpt-4.1",
|
||||
temperature: 0,
|
||||
messages: [
|
||||
{ role: "system", content: systemPrompt },
|
||||
|
|
@ -269,11 +269,11 @@ describe("OpenAiNativeHandler", () => {
|
|||
})
|
||||
|
||||
describe("completePrompt", () => {
|
||||
it("should complete prompt successfully with gpt-4o model", async () => {
|
||||
it("should complete prompt successfully with gpt-4.1 model", async () => {
|
||||
const result = await handler.completePrompt("Test prompt")
|
||||
expect(result).toBe("Test response")
|
||||
expect(mockCreate).toHaveBeenCalledWith({
|
||||
model: "gpt-4o",
|
||||
model: "gpt-4.1",
|
||||
messages: [{ role: "user", content: "Test prompt" }],
|
||||
temperature: 0,
|
||||
})
|
||||
|
|
@ -357,8 +357,8 @@ describe("OpenAiNativeHandler", () => {
|
|||
const modelInfo = handler.getModel()
|
||||
expect(modelInfo.id).toBe(mockOptions.apiModelId)
|
||||
expect(modelInfo.info).toBeDefined()
|
||||
expect(modelInfo.info.maxTokens).toBe(16384)
|
||||
expect(modelInfo.info.contextWindow).toBe(128_000)
|
||||
expect(modelInfo.info.maxTokens).toBe(32768)
|
||||
expect(modelInfo.info.contextWindow).toBe(1047576)
|
||||
})
|
||||
|
||||
it("should handle undefined model ID", () => {
|
||||
|
|
@ -366,7 +366,7 @@ describe("OpenAiNativeHandler", () => {
|
|||
openAiNativeApiKey: "test-api-key",
|
||||
})
|
||||
const modelInfo = handlerWithoutModel.getModel()
|
||||
expect(modelInfo.id).toBe("gpt-4o") // Default model
|
||||
expect(modelInfo.id).toBe("gpt-4.1") // Default model
|
||||
expect(modelInfo.info).toBeDefined()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue