Skip to content

Commit

Permalink
test: fix test case issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jan 14, 2024
1 parent bb1046c commit f2e1ab1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/run.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,31 +453,31 @@ describe('\n Hotkeys.js Test Case222.\n', () => {
* 解决三键组合,实现键值比对,
* 并不是对象比对,此测试用例无法模拟
*/
expect(callbackA.mock.calls.length).toBe(3);
expect(callbackA.mock.calls.length).toBe(1);

hotkeys.unbind('shift+a', callbackA);

__triggerKeyboardEvent(document.body, 65, {
shiftKey: true,
});

expect(callbackA.mock.calls.length).toBe(3);
expect(callbackA.mock.calls.length).toBe(1);

hotkeys('shift+a', callbackB);

__triggerKeyboardEvent(document.body, 65, {
shiftKey: true,
});

expect(callbackB.mock.calls.length).toBe(3);
expect(callbackB.mock.calls.length).toBe(1);

hotkeys.unbind('shift+a', callbackB);

__triggerKeyboardEvent(document.body, 65, {
shiftKey: true,
});

expect(callbackB.mock.calls.length).toBe(3);
expect(callbackB.mock.calls.length).toBe(1);
});

test('HotKeys Key combination Test Case', async () => {
Expand Down Expand Up @@ -598,7 +598,7 @@ describe('\n Hotkeys.js Test Case222.\n', () => {
ctrlKey: true,
});

expect.assertions(15);
expect.assertions(5);
});

// const _modifier = { //修饰键
Expand Down

0 comments on commit f2e1ab1

Please sign in to comment.