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 6fd72ce
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
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 on `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 6fd72ce

Please sign in to comment.