We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Yes
I have an Angular app in which I have a HostListener.
@HostListener('document:keydown', ['$event']) onKeyDown(event: KeyboardEvent) { // Handle keydown event here if (event.ctrlKey || event.metaKey) { this.service.ctrlMode(true); } }
This is my test:
it('should be press ctrKey', () => { spectator.dispatchKeyboardEvent(spectator.element, 'keydown', { key: 'a', keyCode: 65 }); expect(service.ctrlMode()).toBe(false); spectator.dispatchKeyboardEvent(spectator.element, 'keydown', { key: 'Control', keyCode: 17 }); expect(service.ctrlMode()).toBe(true); });
No response
When I call spectator.dispatchKeyboardEvent(spectator.element, 'keydown', { key: 'Control', keyCode: 17 }); the evten.ctrlKey are not true.
"jest": "^29.5.0", "@ngneat/spectator": "^15.0.1",
No
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is this a regression?
Yes
Description
I have an Angular app in which I have a HostListener.
This is my test:
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
No response
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered: