diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-05-13 00:12:11 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-05-13 01:01:10 +0900 |
commit | 5617f6f7650e0eb5711bea5b060e98f0d2e94f46 (patch) | |
tree | 6e7a1f48f82c15beddd0015c1a63ee3df0675d38 /e2e/contents | |
parent | 82aad419a74a3061247d4e82656fa711e63f213c (diff) |
Add e2e test cases for deleting tabs
Diffstat (limited to 'e2e/contents')
-rw-r--r-- | e2e/contents/tab.test.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/e2e/contents/tab.test.js b/e2e/contents/tab.test.js index 880deb8..f0b7449 100644 --- a/e2e/contents/tab.test.js +++ b/e2e/contents/tab.test.js @@ -212,4 +212,36 @@ describe("tab test", () => { expect(win.tabs).to.have.lengthOf(1); }); }); + + it('does not delete pinned tab by d', () => { + return Promise.resolve().then(() => { + return tabs.create(targetWindow.id, SERVER_URL + '#1'); + }).then((tab) => { + return tabs.update(tab.id, { pinned: true }); + }).then((tab) => { + return keys.press(tab.id, 'd'); + }).then(() => { + return windows.get(targetWindow.id); + }).then((win) => { + expect(win.tabs).to.have.lengthOf(2); + }); + }); + + it('deletes pinned tab by !d', () => { + let target; + return Promise.resolve().then(() => { + return tabs.create(targetWindow.id, SERVER_URL + '#1'); + }).then((tab) => { + return tabs.update(tab.id, { pinned: true }); + }).then((tab) => { + target = tab; + return keys.press(target.id, '!'); + }).then(() => { + return keys.press(target.id, 'd'); + }).then(() => { + return windows.get(targetWindow.id); + }).then((win) => { + expect(win.tabs).to.have.lengthOf(1); + }); + }); }); |