test: assert document-viewer link href in doc-search smoke#497
Conversation
Follow-up to #460 (CodeRabbit suggestion): the document-search smoke test verified the "Open document" link is visible but not that it targets the correct viewer location, so a regression opening the wrong document/page could pass. Assert the href matches /documents/<id>?page=<n>(&chunk=<id>) against the mocked search result. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughThe UI smoke test now captures the first “Open document” link and verifies its ChangesDocument link validation
Estimated code review effort: 1 (Trivial) | ~2 minutes Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (10 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a36729824f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/ui-smoke.spec.ts`:
- Line 2157: Update the assertion for openDocumentLink to compare against the
exact href derived from the mocked result data, including the expected document
path, page, and optional chunk parameters, instead of using a shape-only regular
expression.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b36ebdef-6eae-467e-b401-6faeb930bda0
📒 Files selected for processing (1)
tests/ui-smoke.spec.ts
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Addresses Codex P2 + CodeRabbit review: the shape-only regex would still pass if the result linked to the wrong document, page, or chunk. Assert the exact href built from mockDemoApi's lithium result instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1467ec8 to
3224b54
Compare
|
Caution Docstrings generation - FAILED No docstrings were generated. |
Summary
document search mode lists matching documentssmoke test asserted the "Open document" link is visible but not that itshreftargets the correct viewer location. A regression that opened the wrong document/page could therefore pass.hrefmatches/documents/<id>?page=<n>(&chunk=<id>)?against the mocked search result, tightening the viewer-link contract.Test-only change; no production code touched.
Verification
npm run verify:cheap— n/a to a Playwright-only edit; ran the applicable static gates instead.npm run verify:ui— not runnable in this worktree (junctionednode_modulesblocks the Turbopack dev server). TheAdvisory UI regression/Critical UI smokeCI checks exercise this spec on the runner.npm run typecheck— clean.eslint+prettier --checkontests/ui-smoke.spec.ts— clean.The regex was validated by hand against the mocked result the page renders:
/documents/11111111-1111-4111-8111-111111111111?page=1&chunk=44444444-4444-4444-8444-444444444442.Clinical Governance Preflight
Not applicable — test-only change; no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output is affected.
🤖 Generated with Claude Code