feat(e2e): restore kb-librarian-api.spec.ts for /api/kb-librarian endpoints (#3402)#3418
Merged
mrveiss merged 1 commit intoDev_new_guifrom Apr 3, 2026
Merged
feat(e2e): restore kb-librarian-api.spec.ts for /api/kb-librarian endpoints (#3402)#3418mrveiss merged 1 commit intoDev_new_guifrom
mrveiss merged 1 commit intoDev_new_guifrom
Conversation
…points (#3402) Add Playwright e2e tests covering all three KB Librarian HTTP endpoints (status, query, configure) including unauthenticated 401/403 checks, validation error cases (422/400), and authenticated happy-path assertions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
autobot-frontend/tests/e2e/kb-librarian-api.spec.tswhich was deleted in PR chore(backend): clarify kb_librarian is internal-only, delete unreachable e2e tests (#3348) #3368 under the incorrect assumption that the KB Librarian router was intentional dead code/api/kb-librarian(router registered and auth guards added in the companion commit merged as feat(backend): register kb_librarian router at /api/kb-librarian, add auth guards (#3402) #3403):GET /api/kb-librarian/status— unauthenticated 401/403 check + authenticated runtime-config shape assertionsPOST /api/kb-librarian/query— unauthenticated rejection, missing-body 422, valid-query response shape, per-request override acceptancePUT /api/kb-librarian/configure— unauthenticated rejection, out-of-range 400 cases, successful config update echoAuth approach
All three route handlers carry
Depends(get_current_user)imported fromauth_middleware. The e2e tests verify the auth surface by issuing requests without a bearer token (expecting 401/403). Authenticated happy-path tests are gated onE2E_AUTH_TOKENenv var so they skip gracefully in CI where no session token is available.Test plan
E2E_AUTH_TOKENunset: the three unauthenticated-rejection tests pass (401/403 assertions)E2E_AUTH_TOKENset to a valid session token: all authenticated tests pass against a running backendflake8 autobot-backend/api/kb_librarian.py --max-line-length=100exits 0 (verified locally)Closes #3402
🤖 Generated with Claude Code