mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test: client: key: vim: rm skip
This commit is contained in:
parent
4b945c0047
commit
dd240ba9b2
3 changed files with 25 additions and 22 deletions
|
|
@ -97,7 +97,7 @@ async function listener(event, overrides = {}) {
|
|||
return;
|
||||
|
||||
if (isVim)
|
||||
await vim(char, event);
|
||||
vim(char, event);
|
||||
}
|
||||
|
||||
function getSymbol(shift, keyCode) {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue