test(e2e): cover Internal User create-key flow when in no teams#29083
Conversation
The seeded e2e-internal-user is in two teams, so the "no team" branch of the Create Key modal — where the team dropdown must render empty — was unreachable. Seeds a [email protected] user and adds a spec that logs in fresh, opens the modal, and asserts the dropdown has zero options.
Greptile SummaryThis PR closes the last uncovered manual-QA scenario for the Create Key flow: an internal user with no team memberships. It seeds a
Confidence Score: 5/5Safe to merge — all changes are additive E2E test infrastructure with no impact on production code. The change is purely additive: a new seeded user row, a new constant, and two new spec files. The seed is idempotent (existing DELETE block covers e2e-% rows), the two specs are paired to prevent false-positive vacuous passes, and the "No teams found" text anchor correctly resolves the transient-state race from the previous review round. No production logic is modified. No files require special attention; the one style note is in internalUserNoTeam.spec.ts around navigation consistency.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/e2e_tests/constants.ts | Adds E2E_TEAM_ORG_ALIAS constant ("E2E Team In Org") to complete the org-team identifier pair already started with E2E_TEAM_ORG_ID; used by the new paired spec. |
| ui/litellm-dashboard/e2e_tests/fixtures/seed.sql | Seeds e2e-internal-noteam user ([email protected], internal_user role, empty teams array, no LiteLLM_TeamMembership rows) — correctly models the no-team scenario under test. |
| ui/litellm-dashboard/e2e_tests/tests/internal-user/internalUserNoTeam.spec.ts | New spec: logs in fresh as the no-team user, opens Create Key modal, anchors on "No teams found" to wait out the loading spinner, then asserts zero options — avoids the transient-empty race the previous comment flagged. |
| ui/litellm-dashboard/e2e_tests/tests/internal-user/internalUserWithTeams.spec.ts | New spec: differential partner using the stored internal-user session; asserts exactly two options (E2E Team CRUD + E2E Team In Org) preventing the no-team spec's toHaveCount(0) from passing vacuously if the role query never matches. |
Reviews (2): Last reviewed commit: "test(e2e): harden no-team dropdown asser..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…itellm_e2e_internal_user_no_team # Conflicts: # ui/litellm-dashboard/e2e_tests/fixtures/seed.sql
…part Replace the one-shot count() check with a settled-empty assertion: wait for the dropdown's loaded "No teams found" state before asserting zero options, so the test can't pass on a transient empty frame while the team-options request is still in flight. Add internalUserWithTeams.spec.ts as the differential partner; it logs in as the seeded e2e-internal-user (two team memberships) and asserts the dropdown lists exactly those teams. Without it, the no-team spec's zero-options assertion would still pass against a regression that empties the dropdown for every user.
|
@greptileai re review |
8928389
into
litellm_internal_staging
…iAI#29083) * test(e2e): cover Internal User create-key flow when in no teams The seeded e2e-internal-user is in two teams, so the "no team" branch of the Create Key modal — where the team dropdown must render empty — was unreachable. Seeds a [email protected] user and adds a spec that logs in fresh, opens the modal, and asserts the dropdown has zero options. * test(e2e): harden no-team dropdown assertion + add with-teams counterpart Replace the one-shot count() check with a settled-empty assertion: wait for the dropdown's loaded "No teams found" state before asserting zero options, so the test can't pass on a transient empty frame while the team-options request is still in flight. Add internalUserWithTeams.spec.ts as the differential partner; it logs in as the seeded e2e-internal-user (two team memberships) and asserts the dropdown lists exactly those teams. Without it, the no-team spec's zero-options assertion would still pass against a regression that empties the dropdown for every user.
Summary
Adds the last uncovered manual-QA item — "Create Key Flow: Internal User with no personal models and not in any team". The seeded
e2e-internal-useris in two teams, so the empty-team-dropdown branch was unreachable. This PR seeds a new[email protected]user (no team memberships) and adds a spec that logs in fresh, opens the Create Key modal, and asserts the team dropdown has zero options.Logs in inside the test rather than reusing a storage state because adding this user to the Role enum / globalSetup / STORAGE_PATHS for a single assertion isn't worth the maintenance cost.
Test plan
e2e_tests/tests/internal-user/internalUserNoTeam.spec.ts::Create Key team dropdown is empty when the user belongs to no teamsRefs LIT-3093