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