Skip to content

Commit dd240ba

Browse files
committed
test: client: key: vim: rm skip
1 parent 4b945c0 commit dd240ba

3 files changed

Lines changed: 25 additions & 22 deletions

File tree

client/key/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async function listener(event, overrides = {}) {
9797
return;
9898

9999
if (isVim)
100-
await vim(char, event);
100+
vim(char, event);
101101
}
102102

103103
function getSymbol(shift, keyCode) {

client/key/vim/index.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,31 @@ const {
99
selectFileNotParent,
1010
} = require('./set-current');
1111

12-
const {DOM = {}, CloudCmd = {},
13-
} = globalThis;
14-
15-
const {Dialog = {}} = DOM;
16-
17-
const DEPS = {
18-
...DOM,
19-
...CloudCmd,
20-
};
21-
22-
module.exports = async (key, event, deps = DEPS) => {
12+
module.exports = (key, event, overrides = {}) => {
13+
const defaults = {
14+
...globalThis.DOM,
15+
...globalThis.CloudCmd,
16+
};
17+
18+
const deps = {
19+
...defaults,
20+
...overrides,
21+
};
22+
2323
const operations = getOperations(event, deps);
24-
await vim(key, operations, deps);
24+
vim(key, operations, deps);
2525
};
2626

2727
const getOperations = (event, deps) => {
2828
const {
29-
Info = DOM.CurrentInfo,
29+
Info = globalThis.DOM.CurrentInfo,
30+
CloudCmd = globalThis.CloudCmd,
3031
Operation,
3132
unselectFiles,
3233
setCurrentFile,
3334
setCurrentByName,
3435
getCurrentName,
35-
prompt = Dialog.prompt,
36+
prompt = globalThis.DOM.Dialog.prompt,
3637
preventDefault = event?.preventDefault?.bind(event),
3738

3839
toggleSelectedFile,

client/key/vim/index.spec.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,19 +644,21 @@ test('cloudcmd: client: key: make file', (t) => {
644644
t.end();
645645
});
646646

647-
test.skip('cloudcmd: client: vim: terminal', (t) => {
648-
const {CloudCmd} = globalThis;
649-
650-
assign(CloudCmd, {
647+
test('cloudcmd: client: vim: terminal', (t) => {
648+
const CloudCmd = {
651649
Terminal: {
652650
show: stub(),
653651
},
654-
});
652+
};
655653

656654
const event = {};
657655

658-
vim('t', event);
659-
vim('t', event);
656+
vim('t', event, {
657+
CloudCmd,
658+
});
659+
vim('t', event, {
660+
CloudCmd,
661+
});
660662

661663
t.calledWithNoArgs(CloudCmd.Terminal.show);
662664
t.end();

0 commit comments

Comments
 (0)