Spike/add interaction#158
Merged
Merged
Conversation
added 13 commits
October 1, 2025 17:33
orestesrequena
approved these changes
Oct 2, 2025
alfupe
approved these changes
Oct 20, 2025
alfupe
approved these changes
Oct 20, 2025
SalvaCarsi
approved these changes
Oct 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 What?
Added full support and generic typing for centralized interactions in Wrapito (e.g., @testing-library/user-event), including:
New/updated generic types:
InteractionOptions<UserLib, UserInstance, UserSetupOptions>WrapOptions<UserSetupOptions>Config<UserLib, UserInstance, UserSetupOptions>Wrap<UserLib, UserInstance, UserSetupOptions>API:
withInteraction(config)now accepts typed options (SetupOptions) per test.mount()now also returns user?: Instance, the typed instance of the interaction library.Implementation:
getMountretrieves the interaction from getConfig() and generates user using interaction.setup(lib, config) if defined; otherwise, it exposes the lib directly.Consumer typing:
🤔 Why?
Before:
With
userEventv14, each test required manually executinguserEvent.setup(). This implied:setup()for each test.advanceTimersin tests with fake timers).Now:
setupcan be centrally configured in Wrapito'sconfigure().withInteraction().userEventsetup.fireEvent, with the same API and safe typing.🧪 How to use it
Setup
Test example
Declare global