-
Notifications
You must be signed in to change notification settings - Fork 59.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/ConnectAI-E/ChatGPT-Next-Web …
…into feature/update-target-session
- Loading branch information
Showing
6 changed files
with
60 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { getModelProvider } from "../app/utils/model"; | ||
|
||
describe("getModelProvider", () => { | ||
test("should return model and provider when input contains '@'", () => { | ||
const input = "model@provider"; | ||
const [model, provider] = getModelProvider(input); | ||
expect(model).toBe("model"); | ||
expect(provider).toBe("provider"); | ||
}); | ||
|
||
test("should return model and undefined provider when input does not contain '@'", () => { | ||
const input = "model"; | ||
const [model, provider] = getModelProvider(input); | ||
expect(model).toBe("model"); | ||
expect(provider).toBeUndefined(); | ||
}); | ||
|
||
test("should handle multiple '@' characters correctly", () => { | ||
const input = "model@provider@extra"; | ||
const [model, provider] = getModelProvider(input); | ||
expect(model).toBe("model@provider"); | ||
expect(provider).toBe("extra"); | ||
}); | ||
|
||
test("should return empty strings when input is empty", () => { | ||
const input = ""; | ||
const [model, provider] = getModelProvider(input); | ||
expect(model).toBe(""); | ||
expect(provider).toBeUndefined(); | ||
}); | ||
}); |