-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(cdk/testing): add code to keyboard events #30188
Conversation
When the `UnitTestElement` dispatches keyboard event sequences, it sends out fake events which didn't have the `code` property. These changes add mappings for common keys to their codes. Fixes angular#27034.
return `Digit${char}`; | ||
} | ||
|
||
return charsToCodes[char] ?? ''; |
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.
Random thought: we could return <unsupported>
here instead which would make it more obvious that our code doesn't have a mapping for the specific character.
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.
Sounds like a good idea to me, could potentially prevent some bad tests
return `Digit${char}`; | ||
} | ||
|
||
return charsToCodes[char] ?? ''; |
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.
Sounds like a good idea to me, could potentially prevent some bad tests
When the
UnitTestElement
dispatches keyboard event sequences, it sends out fake events which didn't have thecode
property. These changes add mappings for common keys to their codes.Fixes #27034.