fix tests
This commit is contained in:
parent
2990291657
commit
38fc65c541
|
@ -49,6 +49,7 @@ describe("Global configs controller", () => {
|
|||
active: true,
|
||||
isDefault: true,
|
||||
name: "Budibase AI",
|
||||
defaultModel: "",
|
||||
},
|
||||
ai: {
|
||||
active: true,
|
||||
|
@ -86,20 +87,20 @@ describe("Global configs controller", () => {
|
|||
it("Should not update existing secrets when updating an existing AI Config", async () => {
|
||||
const data = structures.configs.ai()
|
||||
await config.api.configs.saveConfig(data)
|
||||
const existingConfig = await config.api.configs.getAIConfig()
|
||||
|
||||
const newConfig: AIInnerConfig = {
|
||||
aiconfig: {
|
||||
ai: {
|
||||
provider: "OpenAI",
|
||||
isDefault: true,
|
||||
apiKey: "--secret-value--",
|
||||
name: "MyConfig",
|
||||
active: true,
|
||||
defaultModel: "gpt4",
|
||||
},
|
||||
}
|
||||
|
||||
await verifyAIConfig(newConfig, existingConfig.body)
|
||||
await verifyAIConfig(newConfig, data)
|
||||
// should be unchanged
|
||||
expect(newConfig.aiconfig.apiKey).toEqual("myapikey")
|
||||
expect(newConfig.ai.apiKey).toEqual("myapikey")
|
||||
})
|
||||
})
|
||||
|
|
|
@ -93,7 +93,7 @@ export function ai(): AIConfig {
|
|||
name: "Test",
|
||||
active: true,
|
||||
defaultModel: "gpt4",
|
||||
apiKey: "abc123APIKey",
|
||||
apiKey: "myapikey",
|
||||
baseUrl: "https://api.example.com",
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue