Add test for quit command
All checks were successful
timw4mail/scroll/pipeline/head This commit looks good

This commit is contained in:
Timothy Warren 2024-07-02 16:59:46 -04:00
parent cf80dce335
commit 76eacd835f

View File

@ -415,8 +415,17 @@ const EditorTest = {
assertTrue(res);
},
'.processKeyPress - ctrl-q': async () => {
// Dirty file (Need to clear confirmation messages)
const e = new Editor(defaultTerminalSize);
const res = await e.processKeyPress(Fn.ctrlKey('q'));
await e.processKeyPress('d');
assertTrue(await e.processKeyPress(Fn.ctrlKey('q')));
assertTrue(await e.processKeyPress(Fn.ctrlKey('q')));
assertTrue(await e.processKeyPress(Fn.ctrlKey('q')));
assertFalse(await e.processKeyPress(Fn.ctrlKey('q')));
// Clean file
const e2 = new Editor(defaultTerminalSize);
const res = await e2.processKeyPress(Fn.ctrlKey('q'));
assertFalse(res);
},
};