Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 660dc56

Browse files
authored
fix(site/src/pages/AISettingsPage): match Formik onSubmit args in Bedrock story (#27211)
> 🤖 This PR was written by Coder Agents on behalf of Jake Howell. Test-only fix for `release/2.34`. ### Problem The `AddBedrockWithoutStaticCredentials` interaction test in `ProviderForm.stories.tsx` asserts: ```ts expect(args.onSubmit).toHaveBeenCalledWith(expect.objectContaining({ type: "bedrock", ... })) ``` Formik invokes `onSubmit(values, formikHelpers)` with **two** arguments, so `toHaveBeenCalledWith` never matches and the storybook/Chromatic interaction test fails deterministically. This breaks storybook CI for **any** PR targeting `release/2.34` (e.g. the #27083 backport in #27144). `main` and `release/2.35` don't hit this because #25848 refactored the story there to forward only `values` to the spy; that refactor was never backported to 2.34. ### Fix Match the second argument with `expect.anything()` so the assertion reflects Formik's actual call signature. Test-only, minimal, no product code change. Verified on 2.34: `ProviderForm` storybook stories (13) pass; lint clean.
1 parent db643c8 commit 660dc56

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

site/src/pages/AISettingsPage/ProvidersPage/components/ProviderForm.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ export const AddBedrockWithoutStaticCredentials: Story = {
9393
accessKey: "",
9494
accessKeySecret: "",
9595
}),
96+
// Formik invokes onSubmit as (values, formikHelpers), so the
97+
// second argument must be matched for the assertion to pass.
98+
expect.anything(),
9699
),
97100
);
98101
},

0 commit comments

Comments
 (0)