|
|
@ -7,14 +7,10 @@ const SERVER_URL = "localhost:11111"; |
|
|
|
|
|
|
|
|
|
|
|
describe("tab test", () => { |
|
|
|
describe("tab test", () => { |
|
|
|
let targetWindow; |
|
|
|
let targetWindow; |
|
|
|
let targetTab; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before(() => { |
|
|
|
before(() => { |
|
|
|
return windows.create().then((win) => { |
|
|
|
return windows.create().then((win) => { |
|
|
|
targetWindow = win; |
|
|
|
targetWindow = win; |
|
|
|
return tabs.create(win.id, SERVER_URL).then((tab) => { |
|
|
|
|
|
|
|
targetTab = tab; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -22,9 +18,10 @@ describe("tab test", () => { |
|
|
|
return windows.remove(targetWindow.id); |
|
|
|
return windows.remove(targetWindow.id); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('delete tab', () => { |
|
|
|
describe('press d', () => { |
|
|
|
return Promise.resolve().then(() => { |
|
|
|
it('deletes tab', () => { |
|
|
|
return keys.press(targetTab.id, 'd'); |
|
|
|
return tabs.create(targetWindow.id, SERVER_URL).then((tab) => { |
|
|
|
|
|
|
|
return keys.press(tab.id, 'd'); |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
return windows.get(targetWindow.id); |
|
|
|
return windows.get(targetWindow.id); |
|
|
|
}).then((after) => { |
|
|
|
}).then((after) => { |
|
|
@ -32,3 +29,20 @@ describe("tab test", () => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}); |
|
|
|