diff --git a/QA.md b/QA.md index 4f37879..e2a6fac 100644 --- a/QA.md +++ b/QA.md @@ -18,6 +18,8 @@ The behaviors of the console are tested in [Console section](#consoles). - [ ] r: reload current tab - [ ] R: reload current tab without cache +- [ ] gh: open start page on current tab +- [ ] gH: open start page to new tab #### Misc diff --git a/e2e/contents/tab.test.js b/e2e/contents/tab.test.js index bfc22ea..3c98dc9 100644 --- a/e2e/contents/tab.test.js +++ b/e2e/contents/tab.test.js @@ -23,6 +23,19 @@ describe("tab test", () => { expect(actual.tabs).to.have.lengthOf(before.tabs.length - 1); }); + it('deletes tabs to the right by D', async () => { + let tab1 = await tabs.create(targetWindow.id, CLIENT_URL + '#1'); + await tabs.create(targetWindow.id, CLIENT_URL + '#2'); + await tabs.create(targetWindow.id, CLIENT_URL + '#3'); + + let before = await windows.get(targetWindow.id) + let tab = await tabs.selectAt(targetWindow.id, tab1.index) + await keys.press(tab.id, 'D', { shiftKey: true }); + + let actual = await windows.get(targetWindow.id); + expect(actual.tabs).to.have.lengthOf(before.tabs.length - 2); + }); + it('duplicates tab by zd', async () => { let tab = await tabs.create(targetWindow.id, CLIENT_URL); let before = await windows.get(targetWindow.id) diff --git a/src/background/usecases/operation.js b/src/background/usecases/operation.js index dd24e75..73e4111 100644 --- a/src/background/usecases/operation.js +++ b/src/background/usecases/operation.js @@ -193,11 +193,15 @@ export default class OperationInteractor { let tab = await this.tabPresenter.getCurrent(); let result = await browser.browserSettings.homepageOverride.get({}); let us = urls.homepageUrls(result.value); + if (us.length === 1 && us[0] === 'about:home') { + // eslint-disable-next-line max-len + throw new Error('Cannot open Firefox Home (about:home) by WebExnteions, set your custom URLs'); + } if (us.length === 1 && !newTab) { return this.tabPresenter.open(us[0], tab.id); } for (let u of us) { - this.tabPresenter.create(u, { openerTabId: tab.id }); + this.tabPresenter.create(u); } } }