test: client: key: vim: rm skip

This commit is contained in:
coderiaser 2026-01-17 14:26:45 +02:00
parent 4b945c0047
commit dd240ba9b2
3 changed files with 25 additions and 22 deletions

View file

@ -97,7 +97,7 @@ async function listener(event, overrides = {}) {
return;
if (isVim)
await vim(char, event);
vim(char, event);
}
function getSymbol(shift, keyCode) {

View file

@ -9,30 +9,31 @@ const {
selectFileNotParent,
} = require('./set-current');
const {DOM = {}, CloudCmd = {},
} = globalThis;
const {Dialog = {}} = DOM;
const DEPS = {
...DOM,
...CloudCmd,
};
module.exports = async (key, event, deps = DEPS) => {
module.exports = (key, event, overrides = {}) => {
const defaults = {
...globalThis.DOM,
...globalThis.CloudCmd,
};
const deps = {
...defaults,
...overrides,
};
const operations = getOperations(event, deps);
await vim(key, operations, deps);
vim(key, operations, deps);
};
const getOperations = (event, deps) => {
const {
Info = DOM.CurrentInfo,
Info = globalThis.DOM.CurrentInfo,
CloudCmd = globalThis.CloudCmd,
Operation,
unselectFiles,
setCurrentFile,
setCurrentByName,
getCurrentName,
prompt = Dialog.prompt,
prompt = globalThis.DOM.Dialog.prompt,
preventDefault = event?.preventDefault?.bind(event),
toggleSelectedFile,

View file

@ -644,19 +644,21 @@ test('cloudcmd: client: key: make file', (t) => {
t.end();
});
test.skip('cloudcmd: client: vim: terminal', (t) => {
const {CloudCmd} = globalThis;
assign(CloudCmd, {
test('cloudcmd: client: vim: terminal', (t) => {
const CloudCmd = {
Terminal: {
show: stub(),
},
});
};
const event = {};
vim('t', event);
vim('t', event);
vim('t', event, {
CloudCmd,
});
vim('t', event, {
CloudCmd,
});
t.calledWithNoArgs(CloudCmd.Terminal.show);
t.end();