Skip to content

fix(ui-tests): add Typography to antd mock in create_key_button test - #27537

Merged
yuneng-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_/hardcore-goldstine-baabae
May 9, 2026
Merged

fix(ui-tests): add Typography to antd mock in create_key_button test#27537
yuneng-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_/hardcore-goldstine-baabae

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

Summary

All 15 tests in ui/litellm-dashboard/src/components/organisms/create_key_button.test.tsx were failing deterministically in CI with:

Error: [vitest] No "Typography" export is defined on the "antd" mock.

PR #27218 switched the key-type dropdown labels in create_key_button.tsx to use Typography.Text / Typography.Paragraph from antd, but the local vi.mock("antd", ...) in the sibling test file does not export Typography. Adding Typography (with .Text, .Paragraph, .Title subcomponents) to the mock restores the test suite.

Test plan

  • npx vitest run src/components/organisms/create_key_button.test.tsx passes locally — all 15 tests green
  • CircleCI litellm-dashboard-ui-tests job passes on this branch

The antd mock omits Typography, which caused all 15 tests in
create_key_button.test.tsx to fail with "No 'Typography' export is
defined on the 'antd' mock" after #27218 switched the key-type
dropdown labels to Typography.Text / Typography.Paragraph.

Add Typography (with .Text, .Paragraph, .Title subcomponents) to the
mock so the dropdown renders in the test environment.
@greptile-apps

greptile-apps Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a deterministic CI failure in the create_key_button test suite by adding the missing Typography export to the local antd vi.mock factory. PR #27218 introduced Typography.Text and Typography.Paragraph in the component without updating the companion test mock, causing all 15 tests to error out.

  • Adds a Typography mock function rendering a div, with .Textspan, .Paragraphp, and .Titleh1 subcomponents attached directly to the constructor — matching the pattern already used for other antd components in the same mock.
  • Exports Typography alongside the other existing mock exports so Vitest can resolve it.

Confidence Score: 5/5

Safe to merge — the change is a minimal, additive mock update that restores a broken test suite without touching production code or weakening any existing assertions.

The change adds three lightweight stub subcomponents to an existing mock factory, exactly mirroring the pattern already in use for other antd components. No test assertions are removed or weakened, no production logic is touched, and the fix directly maps to the import introduced by the referenced prior PR.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/organisms/create_key_button.test.tsx Adds Typography mock (with .Text, .Paragraph, .Title subcomponents) to the antd vi.mock factory, fixing deterministic CI failures caused by the missing export after PR #27218 introduced Typography.Text/Paragraph usage in the component.

Reviews (1): Last reviewed commit: "fix(ui-tests): add Typography to antd mo..." | Re-trigger Greptile

@codecov

codecov Bot commented May 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri enabled auto-merge May 9, 2026 17:17
@yuneng-berri
yuneng-berri merged commit 96f23c2 into litellm_internal_staging May 9, 2026
115 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/hardcore-goldstine-baabae branch May 9, 2026 17:56
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…tine-baabae

fix(ui-tests): add Typography to antd mock in create_key_button test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants