Skip to content

test(frontend): cover FiveW1H with realistic tests and Storybook - #437

Merged
seonghobae merged 4 commits into
worktree-fix-frontend-build-breakfrom
worktree-fix-fivew1h-coverage
Aug 23, 2026
Merged

test(frontend): cover FiveW1H with realistic tests and Storybook#437
seonghobae merged 4 commits into
worktree-fix-frontend-build-breakfrom
worktree-fix-fivew1h-coverage

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds realistic, synthetic-only coverage for the Ask Agent FiveW1H evidence surface: loading, grounded/empty dimensions, mapped and unmapped provenance, optional evidence text, ontology-label/code fallback, multiple values, and the accessible region name.
  • Adds the Storybook inventory states Loading, AllSlotsEmpty, GroundedAnswer, and UnmappedEvidenceSource without changing component behavior or introducing new design tokens.
  • Keeps the branch dependency-correct: the duplicate App/OIDC/Admin diff owned by fix: repair frontend build and publish ontology Pages #426 is removed from this exact head.

Decision and design boundary

  • Existing ADR 0002 remains normative for this buyer surface (Figma File ID 1Su3lDRmiZdcUs47t1QwIX); this test/story-only change makes no new visual or architecture decision.
  • fix: repair frontend build and publish ontology Pages #426 remains the protected-base dependency for the shared App/OIDC TypeScript fix. This PR does not duplicate it.

Exact-head evidence

Validated at head fa17f352d756a88008a7e80567c3e1461f84a5dd, now stacked on exact #426 base b953af68653c2f3bede9e8b5ab48d6d8458c8426:

  • pnpm run test — 149 tests / 14 files passed.
  • focused FiveW1H.test.tsx — 9 tests passed.
  • V8 coverage for FiveW1H.tsx — 100% statements, branches, functions, and lines.
  • pnpm run lint — exit 0; only the two fix: repair frontend build and publish ontology Pages #426-owned protected-base unused-import warnings remain.
  • pnpm run build-storybook — production Storybook build passed and includes Ask Agent/FiveW1H.
  • uv run --extra dev pytest tests/test_documentation_hygiene.py -q — 4 passed.
  • Effective stacked diff contains only FiveW1H.stories.tsx and FiveW1H.test.tsx; no App/OIDC/Admin file remains.
  • Hosted exact-head/base checks are still required. fix: repair frontend build and publish ontology Pages #426 must merge first; then retarget this PR to protected main and obtain fresh checks and independent approval.

Auto-merge is disabled while the base is an unprotected stack branch. This is not a merge-ready claim.

Open in Devin Review

Adds Vitest coverage for loading state, empty-evidence messaging,
raw-source-to-label mapping (including the unmapped fallback), and
optional evidence-text/ontology-badge rendering, plus a Storybook
inventory covering the loading, all-empty, grounded-answer, and
unmapped-source scenarios.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 66f33605-787e-4716-9618-1e3030674e49

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dd461bb9-8cd0-4d1f-9e06-9d52f259f122

📥 Commits

Reviewing files that changed from the base of the PR and between ef6f5a5 and 8ce8c9b.

📒 Files selected for processing (2)
  • frontend/src/components/FiveW1H.stories.tsx
  • frontend/src/components/FiveW1H.test.tsx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

FiveW1H에 Storybook 상태와 Vitest 테스트를 추가했다. 테스트는 슬롯 값, 근거 출처, 온톨로지 정보, 다중 값, 접근성 landmark 렌더링을 검증한다.

Changes

FiveW1H 검증

Layer / File(s) Summary
상태 시나리오와 렌더링 검증
frontend/src/components/FiveW1H.stories.tsx, frontend/src/components/FiveW1H.test.tsx
Storybook에 로딩, 빈 슬롯, 근거 답변, 매핑되지 않은 근거 출처 상태를 추가했다. 테스트는 슬롯 정의, 근거 출처 라벨과 폴백, 선택적 근거·온톨로지 정보, 다중 값, 5W1H region landmark를 검증한다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 8ce8c

This change adds coverage and stories without changing product behavior. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 FiveW1H 컴포넌트의 테스트와 Storybook 스토리 추가라는 주요 변경 사항을 명확하게 요약합니다.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-fix-fivew1h-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Same shared-ancestor bug as #418/#415/#426/#427/#429/#431/#434/#435/#436:
the login button built an unsanitized returnUrl inline instead of
returnUrlFromLocation()/rememberOidcReturnUrl(), and removed the
unreachable login-screen AdminPanel render (accessToken is always
undefined pre-auth). This PR's own diff doesn't touch AdminPanel.
@seonghobae
seonghobae enabled auto-merge (squash) August 22, 2026 12:38
devin-ai-integration[bot]

This comment was marked as resolved.

seonghobae added a commit that referenced this pull request Aug 22, 2026
Same shared-ancestor bug as #418/#415/#426/#427/#429/#431/#434/#435/#436/#437:
the login button built an unsanitized returnUrl inline instead of
returnUrlFromLocation()/rememberOidcReturnUrl(), and removed the
unreachable login-screen AdminPanel render (accessToken is always
undefined pre-auth). This PR's own diff doesn't touch AdminPanel.
seonghobae added a commit that referenced this pull request Aug 22, 2026
Same shared-ancestor bug as #418/#415/#426/#427/#429/#431/#434/#435/#436/#437/#438:
the login button built an unsanitized returnUrl inline instead of
returnUrlFromLocation()/rememberOidcReturnUrl(), and removed the
unreachable login-screen AdminPanel render.
seonghobae added a commit that referenced this pull request Aug 22, 2026
Same shared-ancestor bug as #418/#415/#426/#427/#429/#431/#434/#435/#436/#437/#438/#439:
the login button built an unsanitized returnUrl inline instead of
returnUrlFromLocation()/rememberOidcReturnUrl(), and removed the
unreachable login-screen AdminPanel render.
@opencode-agent
opencode-agent Bot disabled auto-merge August 22, 2026 15:28
@seonghobae
seonghobae enabled auto-merge (squash) August 23, 2026 06:41
@opencode-agent
opencode-agent Bot disabled auto-merge August 23, 2026 07:38
@seonghobae seonghobae changed the title test(frontend): cover FiveW1H component with tests and stories test(frontend): cover FiveW1H and repair login return flow Aug 23, 2026
seonghobae added a commit that referenced this pull request Aug 23, 2026
* test(frontend): add Storybook coverage for BuyerNav

BuyerNav had a test file but no story, the last remaining gap in
frontend/src/components/*.tsx test+story coverage. Adds stories for
each destination plus an edge case with an extra tools slot.

* fix(frontend): use OIDC return-url helpers on the login button

Same shared-ancestor bug as #418/#415/#426/#427/#429/#431/#434/#435/#436/#437:
the login button built an unsanitized returnUrl inline instead of
returnUrlFromLocation()/rememberOidcReturnUrl(), and removed the
unreachable login-screen AdminPanel render (accessToken is always
undefined pre-auth). This PR's own diff doesn't touch AdminPanel.

* test(frontend): cover WorkspaceNav in Storybook
Remove the duplicated OIDC/login changes owned by #426 so this PR carries only its FiveW1H tests and Storybook inventory.
@seonghobae seonghobae changed the title test(frontend): cover FiveW1H and repair login return flow test(frontend): cover FiveW1H with realistic tests and Storybook Aug 23, 2026
@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head review requested for fa17f352d756a88008a7e80567c3e1461f84a5dd. The duplicate #426-owned App/OIDC/Admin diff is now absent; please review only the FiveW1H synthetic tests and Storybook inventory. Hosted checks and independent approval remain required.

@seonghobae
seonghobae changed the base branch from main to worktree-fix-frontend-build-break August 23, 2026 16:17
@seonghobae

Copy link
Copy Markdown
Contributor Author

Stack boundary updated: exact head fa17f352 is based on #426 branch worktree-fix-frontend-build-break at b953af68. Effective diff is only the FiveW1H test and Storybook story. Auto-merge is disabled; after #426 merges, retarget to protected main and obtain fresh checks and independent approval.

seonghobae added a commit that referenced this pull request Aug 23, 2026
* test(frontend): cover LineageDag with tests and stories

LineageDag renders the git-branch-style multi-thread lineage graph
used by both the post-detail popup and the Ask Agent's multi-lineage
answer view (ADR 0120), and had zero test or story coverage despite
being a core, non-trivial component. Adds tests for the empty state,
multi-group branch rendering, group-heading fallback for missing/UUID
groups, click and keyboard node selection, the current-post marker,
and label truncation with an accessible full-label fallback. Adds
stories for empty, single-branch, multi-branch (with an actual fork),
ungrouped, and long-label scenarios.

* fix(frontend): use OIDC return-url helpers on the login button

Same shared-ancestor bug as #418/#415/#426/#427/#429/#431/#434/#435/#436/#437/#438:
the login button built an unsanitized returnUrl inline instead of
returnUrlFromLocation()/rememberOidcReturnUrl(), and removed the
unreachable login-screen AdminPanel render.

* Revert "fix(frontend): use OIDC return-url helpers on the login button"

This reverts commit 590c6c3.

* fix(frontend): keep lineage edge evidence visible-only

* fix(frontend): terminate rooted lineage cycles

* chore(frontend): keep shared OIDC repair on #426

* refactor(frontend): remove unreachable cycle guard

* test(frontend): cover converging lineage DAGs

* fix(frontend): position converging DAG nodes once
@seonghobae
seonghobae merged commit 618238d into worktree-fix-frontend-build-break Aug 23, 2026
4 checks passed
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