Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(settings): correct AI panel test to verify model selection

Steven Enamakelb3bc8ce534b3
diff --git a/app/src/components/settings/panels/__tests__/AIPanel.test.tsx b/app/src/components/settings/panels/__tests__/AIPanel.test.tsx
index 057be2c4d5..6b9207b92b 100644
--- a/app/src/components/settings/panels/__tests__/AIPanel.test.tsx
+++ b/app/src/components/settings/panels/__tests__/AIPanel.test.tsx
@@ -1324,6 +1324,15 @@ describe('AIPanel', () => {
await waitFor(() => expect(screen.getByText(/Add cloud provider/i)).toBeInTheDocument());
expect(screen.getByLabelText(/^Name$/i)).toBeInTheDocument();
expect(screen.getByLabelText(/OpenAI URL/i)).toBeInTheDocument();
+
+ // The API-key row's visible label is associated with the field by `for`
+ // rather than by wrapping it. The old markup wrapped the field's label
+ // around the "clear stored key" button, so clicking that button also
+ // counted as a click on the input.
+ const apiKeyLabel = screen.getByText(/^API Key$/i);
+ expect(apiKeyLabel.tagName).toBe('LABEL');
+ expect(apiKeyLabel).toHaveAttribute('for', 'cloud-provider-api-key');
+ expect(apiKeyLabel.querySelector('button')).toBeNull();
});
// ─── chip toggle: toggle OFF scrubs routing entries ──────────────────────────