Skip to content

Commit f2e1ab1

Browse files
committed
test: fix test case issue.
1 parent bb1046c commit f2e1ab1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/run.test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -453,31 +453,31 @@ describe('\n Hotkeys.js Test Case222.\n', () => {
453453
* 解决三键组合,实现键值比对,
454454
* 并不是对象比对,此测试用例无法模拟
455455
*/
456-
expect(callbackA.mock.calls.length).toBe(3);
456+
expect(callbackA.mock.calls.length).toBe(1);
457457

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

460460
__triggerKeyboardEvent(document.body, 65, {
461461
shiftKey: true,
462462
});
463463

464-
expect(callbackA.mock.calls.length).toBe(3);
464+
expect(callbackA.mock.calls.length).toBe(1);
465465

466466
hotkeys('shift+a', callbackB);
467467

468468
__triggerKeyboardEvent(document.body, 65, {
469469
shiftKey: true,
470470
});
471471

472-
expect(callbackB.mock.calls.length).toBe(3);
472+
expect(callbackB.mock.calls.length).toBe(1);
473473

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

476476
__triggerKeyboardEvent(document.body, 65, {
477477
shiftKey: true,
478478
});
479479

480-
expect(callbackB.mock.calls.length).toBe(3);
480+
expect(callbackB.mock.calls.length).toBe(1);
481481
});
482482

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

601-
expect.assertions(15);
601+
expect.assertions(5);
602602
});
603603

604604
// const _modifier = { //修饰键

0 commit comments

Comments
 (0)