test(ui): pin token-exchange field visibility to the oauth2_token_exchange auth type - #32385
Conversation
Greptile SummaryThis PR adds a single Vitest test to
Confidence Score: 5/5Test-only addition with no production code changes; safe to merge. The change is a single additive test. No existing assertions are weakened, all network calls are mocked, and the test logic is consistent with the surrounding test suite. No production code is touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/mcp_tools/create_mcp_server.test.tsx | Adds one test asserting token-exchange field visibility is gated on the oauth2_token_exchange auth type; no existing tests modified, no real network calls, all mocks in place. |
Reviews (2): Last reviewed commit: "test(ui): assert the stdio transport swi..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…h2_token_exchange auth type No form section asserted the visibility contract: the token-exchange fields (Token Exchange Endpoint, Audience, Subject Token Type) must appear when 'OAuth Token Exchange (OBO)' is selected and for no other auth type. Assert hidden under plain OAuth, shown under token exchange, hidden again after switching to API Key. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ge fields The create form gates the whole Authentication section on non-stdio transport, so selecting OAuth Token Exchange (OBO) and then switching to stdio removes the token-exchange fields (and their required-credential rules, which antd does not validate while unmounted). Pin that sequence so the section-level gate cannot regress silently. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
134edcc to
7ececc3
Compare
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7ececc3. Configure here.
Merging this PR will improve performance by 15.21%
Performance Changes
Tip Curious why this is faster? Comment Comparing |
Relevant issues
Stacked on #31772 (base is that branch; retargets to
litellm_internal_stagingwhen it merges). Follow-up test-only PR split out during #31772's review.Linear ticket
N/A
Type
🧪 Tests
Changes
The create form renders the token-exchange field section (
Token Exchange Endpoint,Client ID,Client Secret,Audience,Subject Token Type,Scopes) only when the auth type isoauth2_token_exchange— both #31772 forms gate it onauthType === AUTH_TYPE.OAUTH2_TOKEN_EXCHANGE. No test asserted that visibility contract in either direction, so a regression (e.g. rendering the section for plainoauth2, or dropping it for token exchange) would pass CI. This adds one test walking the auth selector OAuth → OAuth Token Exchange (OBO) → API Key and asserting the section is hidden, shown, and hidden again.[REQUIRED] Testing
🤖 Generated with Claude Code
Note
Low Risk
Test-only change in the dashboard; no runtime behavior or API surface is modified.
Overview
Adds a Vitest case in
create_mcp_server.test.tsxthat locks in when OAuth token-exchange UI appears on the Add MCP Server form.The test walks Authentication from plain OAuth → OAuth Token Exchange (OBO) → API Key, asserting Token Exchange Endpoint and Subject Token Type stay hidden except for OBO. It also switches transport to Standard Input/Output after OBO and expects those fields to disappear with the HTTP-only Authentication block.
No application or form logic changes—only regression coverage for the
oauth2_token_exchangevisibility contract.Reviewed by Cursor Bugbot for commit 7ececc3. Bugbot is set up for automated code reviews on this repo. Configure here.