Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit d34a2be

Browse files
committed
Pass fake event to focus callbacks
1 parent fcbbb7e commit d34a2be

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/views/tabbable.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import TabGroup from '../../lib/tab-group';
77
describe('makeTabbable', function() {
88
let atomEnv, tabGroup;
99

10+
const e = {
11+
stopPropagation() {},
12+
};
13+
1014
beforeEach(function() {
1115
atomEnv = global.buildAtomEnvironment();
1216
tabGroup = new TabGroup();
@@ -39,11 +43,11 @@ describe('makeTabbable', function() {
3943
commands.prop('target').setter(element);
4044

4145
sinon.stub(tabGroup, 'focusAfter');
42-
commands.find('Command[command="core:focus-next"]').prop('callback')();
46+
commands.find('Command[command="core:focus-next"]').prop('callback')(e);
4347
assert.isTrue(tabGroup.focusAfter.called);
4448

4549
sinon.stub(tabGroup, 'focusBefore');
46-
commands.find('Command[command="core:focus-previous"]').prop('callback')();
50+
commands.find('Command[command="core:focus-previous"]').prop('callback')(e);
4751
assert.isTrue(tabGroup.focusBefore.called);
4852
});
4953

0 commit comments

Comments
 (0)