-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
test(useKeyModifier): add test to cover all features #5051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Move 'dispatchKeyboardEvent' to packages/.test directory for unified management. - Remove duplicate `dispatchKeyboardEvent` implementations in useMagicKeys.
@vueuse/components
@vueuse/core
@vueuse/electron
@vueuse/firebase
@vueuse/integrations
@vueuse/math
@vueuse/metadata
@vueuse/nuxt
@vueuse/router
@vueuse/rxjs
@vueuse/shared
commit: |
describe('params', () => { | ||
describe('events', () => { | ||
it('should be work with custom events', () => { | ||
const state = useKeyModifier('Alt', { events: ['mousedown'] }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this test can you use an actual custom event to prove it works with arbitrary ones?
e.g. testevent
and new CustomEvent('testevent')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, i would update one test i left a comment on but its not a blocker
Before submitting the PR, please make sure you do the following
fixes #123
).Description
What this PR solves:
useKeyModifier
.dispatchKeyboardEvent
to packages/.test directory for unified management.dispatchKeyboardEvent
implementations in useMagicKeys.Additional context
This PR only adds tests without modifying the existing
useKeyModifier
implementation.The test file follows the project's testing conventions and uses the same testing utilities.
No breaking changes or new dependencies are introduced.