1
0
Fork 0
mirror of synced 2024-09-18 02:08:34 +12:00

fix tests

This commit is contained in:
Martin McKeaveney 2024-09-10 22:25:47 +01:00
parent 2990291657
commit 38fc65c541
2 changed files with 6 additions and 5 deletions

View file

@ -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")
})
})

View file

@ -93,7 +93,7 @@ export function ai(): AIConfig {
name: "Test",
active: true,
defaultModel: "gpt4",
apiKey: "abc123APIKey",
apiKey: "myapikey",
baseUrl: "https://api.example.com",
},
},