mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site/src/pages/AgentsPage): reset provider form after create (#23975)
Previously, after creating a provider config in the agents provider editor, the Save changes button stayed enabled for the lifetime of the mounted form. The form kept the pre-create local baseline, so the freshly-saved values still looked dirty. Key `ProviderForm` by provider config identity so React remounts the form when a config is created and re-establishes the pristine state from the saved provider values.
This commit is contained in:
+3
@@ -462,6 +462,9 @@ export const CreateAndUpdateProvider: Story = {
|
||||
await waitFor(() => {
|
||||
expect(args.onCreateProvider).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
await waitFor(() => {
|
||||
expect(body.getByRole("button", { name: "Save changes" })).toBeDisabled();
|
||||
});
|
||||
expect(args.onCreateProvider).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
provider: "openai",
|
||||
|
||||
Reference in New Issue
Block a user