Skip to content

Commit

Permalink
make onKeyPress work
Browse files Browse the repository at this point in the history
  • Loading branch information
bl00mber committed Apr 4, 2020
1 parent c4e3619 commit 223785a
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -453,7 +453,7 @@ describe('SyntheticKeyboardEvent', () => {
});

describe('code', () => {
it('returns code on `keydown`, `keyup` and null on `keypress`', () => {
it('returns code on `keydown`, `keyup` and `keypress`', () => {
let codeDown = null;
let codeUp = null;
let codePress = null;
Expand Down Expand Up @@ -488,13 +488,14 @@ describe('SyntheticKeyboardEvent', () => {
node.dispatchEvent(
new KeyboardEvent('keypress', {
code: 'KeyQ',
charCode: 113,
bubbles: true,
cancelable: true,
}),
);
expect(codeDown).toBe('KeyQ');
expect(codeUp).toBe('KeyQ');
expect(codePress).toBe(null);
expect(codePress).toBe('KeyQ');
});
});
});
Expand Down

0 comments on commit 223785a

Please sign in to comment.