Skip to content

test(home): add unit tests for FAQ component - #3920

Merged
PierreBrisorgueil merged 2 commits into
masterfrom
test/faq-component-unit-tests
Apr 9, 2026
Merged

PierreBrisorgueil merged 2 commits into
masterfrom
test/faq-component-unit-tests

Conversation

@PierreBrisorgueil

@PierreBrisorgueil PierreBrisorgueil commented Apr 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add 14 unit tests for HomeFaqComponent covering:
    • Rendering (expansion panels, question text, subtitle)
    • Column layout (single/dual column split)
    • Null-safety (empty/undefined content, items without question/answer)
    • Computed styles (variant, containerStyle)
    • JSON-LD FAQPage schema generation via useHead

Root cause

Audit finding: FAQ component was added without dedicated unit tests.

Test plan

  • CI passes (lint + unit + E2E)
  • Coverage maintained or improved

Summary by CodeRabbit

  • Tests
    • Added unit test coverage for the FAQ component to ensure reliable functionality.

14 tests covering: rendering, columns, null-safety, computed styles,
and JSON-LD FAQPage schema generation.

Audit finding: FAQ component was added without unit tests.
Copilot AI review requested due to automatic review settings April 9, 2026 08:24
@coderabbitai

coderabbitai Bot commented Apr 9, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@PierreBrisorgueil has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 37 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 21 minutes and 37 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 45775974-de6a-430e-bd83-9a567c80f3ff

📥 Commits

Reviewing files that changed from the base of the PR and between 5dab088 and 33616e3.

📒 Files selected for processing (1)
  • src/modules/home/tests/home.faq.component.unit.tests.js

Walkthrough

This pull request adds a comprehensive unit test suite for the HomeFaqComponent. The tests validate rendering behavior, column layout splitting, null-safety handling, configuration defaults, and JSON-LD schema generation through Vitest and Vuetify mocking.

Changes

Cohort / File(s) Summary
HomeFaqComponent Unit Tests
src/modules/home/tests/home.faq.component.unit.tests.js
New test suite covering component rendering (expansion panels per FAQ item), conditional subtitle display, column splitting logic (default single-column and 2-column configuration), null-safety for empty/undefined content, item filtering by presence of question/answer fields, variant default behavior, max-width style derivation, and JSON-LD FAQPage schema validation via useHead mocking.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the summary and root cause but is missing required sections: Scope, Validation checklist, Guardrails check, and Notes for reviewers. Add missing required sections from the template: Scope (modules impacted, cross-module impact, risk level), Validation (checklist status), Guardrails check (security/merge concerns), and Notes for reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding unit tests for the FAQ component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/faq-component-unit-tests

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 and usage tips.

@codecov

codecov Bot commented Apr 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.25%. Comparing base (534c7a7) to head (33616e3).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3920   +/-   ##
=======================================
  Coverage   99.25%   99.25%           
=======================================
  Files          30       30           
  Lines         944      944           
  Branches      246      246           
=======================================
  Hits          937      937           
  Misses          7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI 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.

Pull request overview

Adds dedicated unit test coverage for HomeFaqComponent to address an audit gap and validate rendering, layout, null-safety, computed styles, and JSON-LD generation behavior.

Changes:

  • Introduces 14 unit tests for HomeFaqComponent rendering and content behavior (including edge cases).
  • Verifies 1 vs 2 column splitting logic and computed style outputs.
  • Validates JSON-LD FAQPage schema generation via useHead (and no-op behavior when content is empty).

Comment thread src/modules/home/tests/home.faq.component.unit.tests.js
Comment thread src/modules/home/tests/home.faq.component.unit.tests.js

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/modules/home/tests/home.faq.component.unit.tests.js`:
- Around line 35-50: The helper functions globalOpts(vuetify) and
makeFaq(overrides) lack JSDoc headers; add JSDoc blocks above each function
including a brief description, a `@param` entry for the parameter (e.g., `@param`
{Object} vuetify - Vuetify instance for globalOpts; `@param` {Object} [overrides]
- optional fields to override default FAQ for makeFaq) and a `@returns` entry
describing the returned object (e.g., `@returns` {Object} - mounting options for
globalOpts; `@returns` {Object} - FAQ object for makeFaq), ensuring types and
optionality are explicit per the repository guidelines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b979e0bc-a9dd-43b2-aaf0-a2995aaa26e9

📥 Commits

Reviewing files that changed from the base of the PR and between 534c7a7 and 5dab088.

📒 Files selected for processing (1)
  • src/modules/home/tests/home.faq.component.unit.tests.js

Comment thread src/modules/home/tests/home.faq.component.unit.tests.js
@PierreBrisorgueil
PierreBrisorgueil merged commit f1223e6 into master Apr 9, 2026
6 checks passed
@PierreBrisorgueil
PierreBrisorgueil deleted the test/faq-component-unit-tests branch April 9, 2026 08:48
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.

2 participants