Skip to content

test: assert document-viewer link href in doc-search smoke#497

Merged
BigSimmo merged 2 commits into
mainfrom
claude/doc-search-smoke-href-9c41ee
Jul 11, 2026
Merged

test: assert document-viewer link href in doc-search smoke#497
BigSimmo merged 2 commits into
mainfrom
claude/doc-search-smoke-href-9c41ee

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • Follow-up to fix: wire document search command centre to live /api/search #460 addressing a CodeRabbit review suggestion: the document search mode lists matching documents smoke test asserted the "Open document" link is visible but not that its href targets the correct viewer location. A regression that opened the wrong document/page could therefore pass.
  • Assert the link's href matches /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:uinot runnable in this worktree (junctioned node_modules blocks the Turbopack dev server). The Advisory UI regression / Critical UI smoke CI checks exercise this spec on the runner.
  • npm run typecheck — clean.
  • eslint + prettier --check on tests/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

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>
@supabase

supabase Bot commented Jul 11, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The UI smoke test now captures the first “Open document” link and verifies its href targets the mocked document viewer with page and optional chunk query parameters.

Changes

Document link validation

Layer / File(s) Summary
Viewer link URL assertion
tests/ui-smoke.spec.ts
The test retains the visibility check and adds a regular-expression assertion for the document viewer URL format.

Estimated code review effort: 1 (Trivial) | ~2 minutes


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Verification Claims ❌ Error The PR summary says typecheck/ESLint/Prettier passed without exact commands; this check requires explicit command/result wording. Rewrite verification notes as explicit entries, e.g. “Ran npm run typecheck: passed”, “Ran eslint + prettier --check on tests/ui-smoke.spec.ts: passed”, and “Not run: ”.
✅ Passed checks (10 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main test-only change to assert the document-viewer link href.
Description check ✅ Passed The description matches the template well, with Summary, Verification, and Clinical Governance sections filled in appropriately.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Generated And Sensitive Files ✅ Passed Only tests/ui-smoke.spec.ts changed, and the diff is a small assertion update with no secrets, credentials, generated outputs, or machine-local files.
Risky Git Or Deployment Actions ✅ Passed The PR only tightens a Playwright test assertion; it adds no force-push, reset, destructive clean, branch deletion, or deployment guidance.
Supabase Project And Schema Safety ✅ Passed PR only tightens a UI smoke test href assertion; no Supabase project refs, schema/migration, RLS, policy, or env changes are present.
Runtime And Package Manager Integrity ✅ Passed Only tests/ui-smoke.spec.ts changed; no package.json, lockfile, .npmrc, or Node-version/runtime files were modified.
Api Route Failure Handling ✅ Passed Not applicable: the PR only tightens a UI smoke-test href assertion and does not change any API route, action, RAG, search, ingestion, or provider logic.
✨ Finishing Touches
📝 Generate docstrings
  • ✅ Generated successfully - (🔄 Check to regenerate)
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/doc-search-smoke-href-9c41ee
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/doc-search-smoke-href-9c41ee

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tests/ui-smoke.spec.ts Outdated
coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 70ec640 and a367298.

📒 Files selected for processing (1)
  • tests/ui-smoke.spec.ts

Comment thread tests/ui-smoke.spec.ts Outdated
@BigSimmo
BigSimmo enabled auto-merge (squash) July 11, 2026 14:22
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

Files modified:

  • tests/ui-smoke.spec.ts

Commit: 1467ec848472495208a227fb21d679bcbbc1c31a

The changes have been pushed to the claude/doc-search-smoke-href-9c41ee branch.

Time taken: 2m 53s

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>
@BigSimmo
BigSimmo force-pushed the claude/doc-search-smoke-href-9c41ee branch from 1467ec8 to 3224b54 Compare July 11, 2026 14:31
@BigSimmo
BigSimmo merged commit d6f345a into main Jul 11, 2026
16 checks passed
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Caution

Docstrings generation - FAILED

No docstrings were generated.

@BigSimmo
BigSimmo deleted the claude/doc-search-smoke-href-9c41ee branch July 11, 2026 15:28
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.

1 participant