fix tests

This commit is contained in:
Martin McKeaveney 2024-10-23 11:13:52 +01:00
parent 6541f6d31f
commit 8f0a234ae3
3 changed files with 5 additions and 10 deletions

View File

@ -51,6 +51,7 @@ const ACTION_IMPLS: ActionImplType = {
QUERY_ROWS: queryRow.run, QUERY_ROWS: queryRow.run,
COLLECT: collect.run, COLLECT: collect.run,
TRIGGER_AUTOMATION_RUN: triggerAutomationRun.run, TRIGGER_AUTOMATION_RUN: triggerAutomationRun.run,
OPENAI: openai.run,
// these used to be lowercase step IDs, maintain for backwards compat // these used to be lowercase step IDs, maintain for backwards compat
discord: discord.run, discord: discord.run,
slack: slack.run, slack: slack.run,
@ -107,8 +108,6 @@ export async function getActionDefinitions() {
(await features.flags.isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS)) (await features.flags.isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS))
) { ) {
BUILTIN_ACTION_DEFINITIONS["OPENAI"] = openai.definition BUILTIN_ACTION_DEFINITIONS["OPENAI"] = openai.definition
// @ts-ignore
ACTION_IMPLS["OPENAI"] = openai.run
} }
const actionDefinitions = BUILTIN_ACTION_DEFINITIONS const actionDefinitions = BUILTIN_ACTION_DEFINITIONS

View File

@ -126,16 +126,16 @@ export type ActionImplementations<T extends Hosting> = {
n8nStepInputs, n8nStepInputs,
ExternalAppStepOutputs ExternalAppStepOutputs
> >
[AutomationActionStepId.OPENAI]: ActionImplementation<
OpenAIStepInputs,
OpenAIStepOutputs
>
} & (T extends "self" } & (T extends "self"
? { ? {
[AutomationActionStepId.EXECUTE_BASH]: ActionImplementation< [AutomationActionStepId.EXECUTE_BASH]: ActionImplementation<
BashStepInputs, BashStepInputs,
BashStepOutputs BashStepOutputs
> >
[AutomationActionStepId.OPENAI]: ActionImplementation<
OpenAIStepInputs,
OpenAIStepOutputs
>
} }
: {}) : {})

View File

@ -13,10 +13,6 @@ describe("Global configs controller", () => {
await config.afterAll() await config.afterAll()
}) })
afterEach(() => {
jest.resetAllMocks()
})
it("Should strip secrets when pulling AI config", async () => { it("Should strip secrets when pulling 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)