diff options
author | chocolateboy <chocolate@cpan.org> | 2019-07-28 05:35:07 +0100 |
---|---|---|
committer | chocolateboy <chocolate@cpan.org> | 2019-07-28 20:34:53 +0100 |
commit | 6605d3ea99c364a8f5f9d98a33e3ac89afb035f7 (patch) | |
tree | 341b3d4f6a7916e62ce1d96bdd440c6295c45a8c /e2e | |
parent | 3db11041c5b75c30b584893937876b6471e67cf2 (diff) |
Add an option to close the current tab and select the tab to the left
Add an option to tabs.close to close the current tab
and select the tab to the left.
Bound to `D` by default, which replaces the tabs.close.right
command, which is rarely-used. [1]
The old `D` behavior has been moved to `gd`.
+ update the README and fix some lint errors
[1] https://tinyurl.com/y4mj7hjy
Diffstat (limited to 'e2e')
-rw-r--r-- | e2e/settings.js | 3 | ||||
-rw-r--r-- | e2e/tab.test.js | 20 |
2 files changed, 19 insertions, 4 deletions
diff --git a/e2e/settings.js b/e2e/settings.js index e09747f..e3e9787 100644 --- a/e2e/settings.js +++ b/e2e/settings.js @@ -24,7 +24,8 @@ module.exports = { "G": { "type": "scroll.bottom" }, "$": { "type": "scroll.end" }, "d": { "type": "tabs.close" }, - "D": { "type": "tabs.close.right" }, + "D": { "type": "tabs.close", "selectLeft": true }, + "gd": { "type": "tabs.close.right" }, "!d": { "type": "tabs.close.force" }, "u": { "type": "tabs.reopen" }, "K": { "type": "tabs.prev", "count": 1 }, diff --git a/e2e/tab.test.js b/e2e/tab.test.js index 16d61ae..aaaa5d7 100644 --- a/e2e/tab.test.js +++ b/e2e/tab.test.js @@ -55,18 +55,32 @@ describe("tab test", () => { await browser.windows.remove(win.id); }); - it('deletes tab by d', async () => { + it('deletes tab and selects right by d', async () => { + await browser.tabs.update(tabs[3].id, { active: true }); let body = await session.findElementByCSS('body'); await body.sendKeys('d'); let current = await browser.tabs.query({ windowId: win.id }); assert(current.length === tabs.length - 1); + assert(current[3].active); + assert(current[3].url === tabs[4].url); + }); + + it('deletes tab and selects left by D', async () => { + await browser.tabs.update(tabs[3].id, { active: true }); + let body = await session.findElementByCSS('body'); + await body.sendKeys(Key.Shift, 'D'); + + let current = await browser.tabs.query({ windowId: win.id }); + assert(current.length === tabs.length - 1); + assert(current[2].active); + assert(current[2].url === tabs[2].url); }); - it('deletes tabs to the right by D', async () => { + it('deletes all tabs to the right by gD', async () => { await browser.tabs.update(tabs[1].id, { active: true }); let body = await session.findElementByCSS('body'); - await body.sendKeys(Key.Shift, 'd'); + await body.sendKeys('g', Key.Shift, 'D'); let current = await browser.tabs.query({ windowId: win.id }); assert(current.length === 2); |