Skip to content

🔧 Expand Test Coverage Across Components, Contexts, and Utilities#106

Merged
cristiantela merged 10 commits intov3-mainfrom
test/encrease-unit-tests
May 7, 2026
Merged

🔧 Expand Test Coverage Across Components, Contexts, and Utilities#106
cristiantela merged 10 commits intov3-mainfrom
test/encrease-unit-tests

Conversation

@cristiantela
Copy link
Copy Markdown
Collaborator

@cristiantela cristiantela commented May 7, 2026

Description

Type of Change

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Tests
  • Other

Motivation and Context

Several modules and components lacked unit test coverage, making it harder to catch regressions. This PR adds test suites for the areas with the most missing coverage and removes leftover console.log statements from VTEXIOMinicartBridge that were left over from debugging.

Summary of Changes

  • MessagesList — Extended and added unit tests covering message rendering, scroll behavior, and edge cases.
  • VTEXIOMinicartBridge — Added unit tests for cart merging, image preservation, and updateVTEXIOMinicart flow. Removed debug console.log calls that leaked internal state messages to the browser console.
  • OrderFormContext — Added unit tests for context state, order form lifecycle, and cart sync logic.
  • Dropdown — Added unit tests covering open/close behavior, placement classes, renderTrigger, outside-click dismissal, Escape key handling, and ARIA attributes.
  • Tooltip — Added unit tests covering hover/focus visibility, disabled prop, preserved child event handlers, and aria-describedby linking.
  • useVtexCxVisualViewportCssVars — Added unit tests for syncVtexCxVisualViewportCssVars (both visualViewport and fallback paths), listener registration, cleanup on unmount, and active toggling.
  • CounterControls — Added unit tests covering counter increment/decrement, hideWhenNotInteracted visibility logic, uuid parsing, add-to-cart FSButton rendering, and async cart addition flow.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.82%. Comparing base (2b28c50) to head (287f28e).

Additional details and impacted files
@@             Coverage Diff              @@
##           v3-main     #106       +/-   ##
============================================
+ Coverage    61.94%   72.82%   +10.87%     
============================================
  Files           81       81               
  Lines         3747     3742        -5     
  Branches      1024     1000       -24     
============================================
+ Hits          2321     2725      +404     
+ Misses        1378      987      -391     
+ Partials        48       30       -18     

☔ 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.

@cristiantela cristiantela changed the title Add unit tests for MessagesList component 🔧 Expand Test Coverage Across Components, Contexts, and Utilities May 7, 2026
@cristiantela cristiantela marked this pull request as ready for review May 7, 2026 19:29
@cristiantela cristiantela requested a review from Aldemylla as a code owner May 7, 2026 19:29
@cristiantela cristiantela merged commit b4e6cdd into v3-main May 7, 2026
2 checks passed
@cristiantela cristiantela deleted the test/encrease-unit-tests branch May 7, 2026 19:55
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.

3 participants