aboutsummaryrefslogtreecommitdiff
path: root/e2e/contents/tab.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'e2e/contents/tab.test.js')
-rw-r--r--e2e/contents/tab.test.js36
1 files changed, 25 insertions, 11 deletions
diff --git a/e2e/contents/tab.test.js b/e2e/contents/tab.test.js
index dda572f..198bf0a 100644
--- a/e2e/contents/tab.test.js
+++ b/e2e/contents/tab.test.js
@@ -7,14 +7,10 @@ const SERVER_URL = "localhost:11111";
describe("tab test", () => {
let targetWindow;
- let targetTab;
before(() => {
return windows.create().then((win) => {
targetWindow = win;
- return tabs.create(win.id, SERVER_URL).then((tab) => {
- targetTab = tab;
- });
});
});
@@ -22,13 +18,31 @@ describe("tab test", () => {
return windows.remove(targetWindow.id);
});
- it('delete tab', () => {
- return Promise.resolve().then(() => {
- return keys.press(targetTab.id, 'd');
- }).then(() => {
- return windows.get(targetWindow.id);
- }).then((after) => {
- expect(after.tabs).to.have.lengthOf(1);
+ describe('press d', () => {
+ it('deletes tab', () => {
+ return tabs.create(targetWindow.id, SERVER_URL).then((tab) => {
+ return keys.press(tab.id, 'd');
+ }).then(() => {
+ return windows.get(targetWindow.id);
+ }).then((after) => {
+ expect(after.tabs).to.have.lengthOf(1);
+ });
});
});
+
+ describe('press zd', () => {
+ it('duplicates tab', () => {
+ let targetTab = 0;
+ return tabs.create(targetWindow.id, SERVER_URL).then((tab) => {
+ targetTab = tab;
+ return keys.press(targetTab.id, 'z');
+ }).then(() => {
+ return keys.press(targetTab.id, 'd');
+ }).then(() => {
+ return windows.get(targetWindow.id);
+ }).then((after) => {
+ expect(after.tabs).to.have.lengthOf(3);
+ });
+ });
+ })
});