Add e2e test cases for deleting tabs
This commit is contained in:
parent
82aad419a7
commit
5617f6f765
6 changed files with 52 additions and 5 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Reference in a new issue