Skip to content

feat: fireEvent.press/scroll default event object#1884

Open
mdjastrzebski wants to merge 10 commits intomainfrom
feat/fire-event-event-object
Open

feat: fireEvent.press/scroll default event object#1884
mdjastrzebski wants to merge 10 commits intomainfrom
feat/fire-event-event-object

Conversation

@mdjastrzebski
Copy link
Member

@mdjastrzebski mdjastrzebski commented Feb 16, 2026

Summary

Promote event-builder module from user-event/event-builder to a top-level src/event-builder module and use it in fireEvent to provide proper event objects.

Changes

  • Move event-builder to src/event-builder/: Relocated from src/user-event/event-builder/ so it can be shared across both fireEvent and userEvent APIs.
  • Flatten event builder API: Replace namespaced EventBuilder.Common.* / EventBuilder.TextInput.* / EventBuilder.ScrollView.* pattern with flat, named function exports (e.g., buildTouchEvent(), buildScrollEvent(), buildTextChangeEvent()).
  • Enhance fireEvent.press and fireEvent.scroll: These now automatically construct proper event objects (touch event for press, scroll event for scroll) instead of passing raw user data. Custom event props are deep-merged into the default event structure.
  • Consolidate types: Move TextRange into src/types.ts alongside Point and Size (removing src/user-event/utils/text-range.ts).
  • Update all userEvent consumers: Migrate all imports from the old EventBuilder namespace to the new flat exports.

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.30%. Comparing base (0a01a73) to head (45067f8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1884      +/-   ##
==========================================
+ Coverage   98.28%   98.30%   +0.01%     
==========================================
  Files          80       79       -1     
  Lines        1459     1475      +16     
  Branches      381      408      +27     
==========================================
+ Hits         1434     1450      +16     
  Misses         24       24              
  Partials        1        1              

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

@mdjastrzebski mdjastrzebski changed the title Feat/fire event event object feat: fireEvent.press/scroll default event object Feb 16, 2026
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