GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — test: stabilize source regression assertions for current UI by BigSimmo · Pull Request #805 · BigSimmo/PsychSift Conversation
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
📝 WalkthroughWalkthroughThe PR updates audit regression tests for service comparison, seeded form provenance, source-link rendering, private API gating, polling and mutation contracts, and the root dashboard heading. ChangesContent-service audit updates
Navigation and authentication audit updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
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/audit-content-services-regressions.test.ts`:
- Around line 206-207: Update the normalizedFormDetailSource matcher in the
anchor-label regression test so the pattern cannot cross the closing </a> tag
before matching “Official”. Keep the assertion focused on the <a
href={form.source.url}> element and require “Official” within that anchor’s
contents; retain the separate formDetailSource containment check only if it
remains necessary.
In `@tests/audit-navigation-auth-regressions.test.ts`:
- Around line 124-126: Update the heading assertion in the “keeps the root
dashboard H1 as Clinical KB” test to match only the exact “Clinical KB” text,
removing the alternation that also permits “Clinical Guide”; preserve the
existing H1 structure and whitespace handling.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b467aa4-640f-4c68-ba06-405f6c856959
tests/audit-content-services-regressions.test.tstests/audit-navigation-auth-regressions.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| expect(normalizedFormDetailSource).toMatch(/<a href=\{form\.source\.url\}[^>]*>[\s\S]*Official/); | ||
| expect(formDetailSource).toContain("Official"); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Constrain “Official” to the source URL anchor.
This matcher can cross </a> and pass on an unrelated later “Official” string, so it does not reliably protect the anchor label contract.
- expect(normalizedFormDetailSource).toMatch(/<a href=\{form\.source\.url\}[^>]*>[\s\S]*Official/); + expect(normalizedFormDetailSource).toMatch( + /<a href=\{form\.source\.url\}[^>]*>(?:(?!<\/a>)[\s\S])*Official/, + );
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| expect(normalizedFormDetailSource).toMatch(/<a href=\{form\.source\.url\}[^>]*>[\s\S]*Official/); | |
| expect(formDetailSource).toContain("Official"); | |
| expect(normalizedFormDetailSource).toMatch( | |
| /<a href=\{form\.source\.url\}[^>]*>(?:(?!<\/a>)[\s\S])*Official/, | |
| ); | |
| expect(formDetailSource).toContain("Official"); |
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/audit-content-services-regressions.test.ts` around lines 206 - 207,
Update the normalizedFormDetailSource matcher in the anchor-label regression
test so the pattern cannot cross the closing </a> tag before matching
“Official”. Keep the assertion focused on the <a href={form.source.url}> element
and require “Official” within that anchor’s contents; retain the separate
formDetailSource containment check only if it remains necessary.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| it("keeps the root dashboard H1 as Clinical KB", () => { | ||
| expect(clinicalDashboardSource.match(/<h1\b/g)).toHaveLength(1); | ||
| expect(clinicalDashboardSource).toMatch(/<h1 className="sr-only">\s*Clinical Guide\s*<\/h1>/); | ||
| expect(clinicalDashboardSource).toMatch(/<h1 className="sr-only">\s*Clinical (?:Guide|KB)\s*<\/h1>/); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Require the exact Clinical KB heading.
This regex accepts the old Clinical Guide value, so the test passes against the supplied src/components/ClinicalDashboard.tsx implementation even though the test name requires Clinical KB. Use an exact Clinical KB match, or retain an exact Clinical Guide expectation if no UI change is intended.
- expect(clinicalDashboardSource).toMatch(/<h1 className="sr-only">\s*Clinical (?:Guide|KB)\s*<\/h1>/); + expect(clinicalDashboardSource).toMatch(/<h1 className="sr-only">\s*Clinical KB\s*<\/h1>/);
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| it("keeps the root dashboard H1 as Clinical KB", () => { | |
| expect(clinicalDashboardSource.match(/<h1\b/g)).toHaveLength(1); | |
| expect(clinicalDashboardSource).toMatch(/<h1 className="sr-only">\s*Clinical Guide\s*<\/h1>/); | |
| expect(clinicalDashboardSource).toMatch(/<h1 className="sr-only">\s*Clinical (?:Guide|KB)\s*<\/h1>/); | |
| it("keeps the root dashboard H1 as Clinical KB", () => { | |
| expect(clinicalDashboardSource.match(/<h1\b/g)).toHaveLength(1); | |
| expect(clinicalDashboardSource).toMatch(/<h1 className="sr-only">\s*Clinical KB\s*<\/h1>/); |
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/audit-navigation-auth-regressions.test.ts` around lines 124 - 126,
Update the heading assertion in the “keeps the root dashboard H1 as Clinical KB”
test to match only the exact “Clinical KB” text, removing the alternation that
also permits “Clinical Guide”; preserve the existing H1 structure and whitespace
handling.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.