Skip to content

test(e2e): cover Internal Viewer nav, key, and team-info gating - #29075

Merged
yuneng-berri merged 2 commits into
litellm_internal_stagingfrom
litellm_e2e_internal_viewer_role
May 29, 2026
Merged

test(e2e): cover Internal Viewer nav, key, and team-info gating#29075
yuneng-berri merged 2 commits into
litellm_internal_stagingfrom
litellm_e2e_internal_viewer_role

Conversation

@ryan-crabbe-berri

@ryan-crabbe-berri ryan-crabbe-berri commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds e2e coverage for three previously-uncovered Internal Viewer manual-QA items, using INTERNAL_VIEWER_STORAGE_PATH:

Test plan

  • e2e_tests/tests/internal-viewer/internalViewer.spec.ts::Nav shows only the allowed options for the Internal Viewer role
  • e2e_tests/tests/internal-viewer/internalViewer.spec.ts::Virtual Keys page hides Create / Regenerate / Reset / Delete controls
  • e2e_tests/tests/internal-viewer/internalViewer.spec.ts::Team info page omits Members and Settings tabs for an Internal Viewer

Refs LIT-3093

Three previously-uncovered manual-QA paths for the Internal Viewer role:

- Nav only renders the read-only sections; admin-only items
  (Internal Users, Organizations, Models + Endpoints) stay hidden.
- Virtual Keys page hides Create New Key, and the key detail view
  hides Regenerate / Reset Spend / Delete actions.
- Team info page hides Members and Settings tabs for the viewer.
@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a new Playwright e2e spec covering three Internal Viewer role-gating scenarios that were previously manual-QA items. All assertions use navigateToPage() for stable networkidle settling, consistent toHaveCount(0) for absent-element checks, and toBeVisible for every tab stated as always visible.

  • Nav test: iterates expectedVisible labels via getByRole("link") scoped to the complementary landmark, then asserts admin-only items are absent from the DOM.
  • Virtual Keys test: confirms Create/Regenerate/Reset/Delete controls are hidden, navigating into the viewer's own key via seed-data alias E2E_VIEWER_KEY_ALIAS.
  • Team info test: verifies Overview and Virtual Keys tabs render while Settings and Members tabs are absent, driven by the seeded E2E_TEAM_CRUD_ID team.

Confidence Score: 5/5

This PR is safe to merge — it adds only new test code and touches no production logic.

The change is a purely additive test file with no modifications to production code, helpers, or fixtures. All previously-raised review concerns have been resolved: the networkidle race is eliminated by using navigateToPage, the redundant popup-dismiss call is gone, the Virtual Keys tab is now asserted visible, and the hidden-element checks use toHaveCount(0) consistently throughout.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/e2e_tests/tests/internal-viewer/internalViewer.spec.ts New test file adding three e2e scenarios for Internal Viewer role gating: nav visibility, key-page write-control hiding, and team info tab filtering. All previously-raised review concerns have been resolved in this revision.

Reviews (2): Last reviewed commit: "test(e2e): scope viewer nav to sidebar, ..." | Re-trigger Greptile

Comment thread ui/litellm-dashboard/e2e_tests/tests/internal-viewer/internalViewer.spec.ts Outdated
Comment thread ui/litellm-dashboard/e2e_tests/tests/internal-viewer/internalViewer.spec.ts Outdated
Comment thread ui/litellm-dashboard/e2e_tests/tests/internal-viewer/internalViewer.spec.ts Outdated
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Address review feedback on the Internal Viewer e2e spec:
- Scope the nav test to the sidebar complementary landmark and match
  items by link role + accessible name. The prior CSS nav, aside
  selector grabbed the top bar (the sidebar is a complementary
  landmark, not a <nav> tag), so the assertions never hit the real
  nav links.
- Land via navigateToPage so the networkidle wait settles the
  role-gated nav before asserting.
- Assert the Virtual Keys tab is visible (was only commented).
- Use toHaveCount(0) for hidden team tabs to match the nav block;
  tabs are conditionally rendered, not CSS-hidden.
- Drop redundant dismissFeedbackPopup calls (navigateToPage already
  dismisses internally).
@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

@greptileai re review

@yuneng-berri
yuneng-berri merged commit 10bda44 into litellm_internal_staging May 29, 2026
114 of 118 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…iAI#29075)

* test(e2e): cover Internal Viewer nav, key, and team-info gating

Three previously-uncovered manual-QA paths for the Internal Viewer role:

- Nav only renders the read-only sections; admin-only items
  (Internal Users, Organizations, Models + Endpoints) stay hidden.
- Virtual Keys page hides Create New Key, and the key detail view
  hides Regenerate / Reset Spend / Delete actions.
- Team info page hides Members and Settings tabs for the viewer.

* test(e2e): scope viewer nav to sidebar, strengthen tab assertions

Address review feedback on the Internal Viewer e2e spec:
- Scope the nav test to the sidebar complementary landmark and match
  items by link role + accessible name. The prior CSS nav, aside
  selector grabbed the top bar (the sidebar is a complementary
  landmark, not a <nav> tag), so the assertions never hit the real
  nav links.
- Land via navigateToPage so the networkidle wait settles the
  role-gated nav before asserting.
- Assert the Virtual Keys tab is visible (was only commented).
- Use toHaveCount(0) for hidden team tabs to match the nav block;
  tabs are conditionally rendered, not CSS-hidden.
- Drop redundant dismissFeedbackPopup calls (navigateToPage already
  dismisses internally).
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.

2 participants