test(e2e): assert internal-user navbar identity is scoped to that user - #29077
Conversation
The existing login.spec.ts only checks the admin's navbar identity. This adds the symmetric check for the internal user — verifying the account button + dropdown surface the internal user's email, id, and role, and that no admin-scoped values leak through.
Greptile SummaryThis PR adds a Playwright e2e test that verifies an internal user's session is correctly scoped in the navbar — confirming their own email, user ID, and role appear in the account button's
Confidence Score: 5/5Safe to merge — all changes are additive (new test + one data-testid attribute) with no runtime behaviour change. The production code change is a single data-testid attribute on a non-interactive wrapper div, which has no effect on rendering or logic. The new e2e spec is purely additive, well-scoped to the internal-user session, and correctly uses positive and negative assertions against a stable test-id locator. No files require special attention.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/e2e_tests/constants.ts | Adds four new exported constants for seeded proxy-admin and internal-user identities (email + user ID), clearly annotated to match seed.sql. |
| ui/litellm-dashboard/e2e_tests/tests/login/internalUserIdentity.spec.ts | New Playwright e2e spec; verifies navbar aria-label and dropdown panel show the internal user's email/ID/role and confirm no proxy-admin values leak through. Uses data-testid locator to avoid fragile class-name selectors. |
| ui/litellm-dashboard/src/components/Navbar/UserDropdown/UserDropdown.tsx | Minimal one-attribute change: adds data-testid="user-dropdown-panel" to the popupRender wrapper div so tests can locate it without coupling to Ant Design or Tailwind class names. |
Reviews (2): Last reviewed commit: "test(e2e): harden navbar identity test p..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Locate the user dropdown panel by a data-testid on the popupRender div instead of Ant Design internal + Tailwind class names, so styling refactors no longer risk breaking the identity-scoping assertions. Source the seeded user emails/ids from shared constants (match seed.sql) instead of hardcoding them inline.
|
@greptileai re review |
37e6e2d
into
litellm_internal_staging
BerriAI#29077) * test(e2e): assert internal-user navbar identity is scoped to that user The existing login.spec.ts only checks the admin's navbar identity. This adds the symmetric check for the internal user — verifying the account button + dropdown surface the internal user's email, id, and role, and that no admin-scoped values leak through. * test(e2e): harden navbar identity test per review feedback Locate the user dropdown panel by a data-testid on the popupRender div instead of Ant Design internal + Tailwind class names, so styling refactors no longer risk breaking the identity-scoping assertions. Source the seeded user emails/ids from shared constants (match seed.sql) instead of hardcoding them inline.
Summary
Adds the symmetric e2e check to the existing admin login test — verifying that signing in as an internal user surfaces their email / user_id / role in the navbar account button and dropdown, and that no admin-scoped values leak through. This covers the previously-uncovered manual-QA step "Sign in as the new user — UI should load only info for the new internal user (not Proxy Admin)".
Test plan
e2e_tests/tests/login/internalUserIdentity.spec.ts::Internal user navbar dropdown shows their own role and user id, not the admin'sRefs LIT-3093