aboutsummaryrefslogtreecommitdiff
path: root/e2e/contents/tab.test.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-02-15 20:12:29 +0900
committerGitHub <noreply@github.com>2018-02-15 20:12:29 +0900
commit9f1da8b9e4969ca3b51bf84b61ea95f284cb13c9 (patch)
tree72e7ccf6b57dbdd855f433af6ff141fe37638bfe /e2e/contents/tab.test.js
parenta48915d4e090378a672d780b2fbc93e1af6e082c (diff)
parent30d6872fa833861bc479494b2951e196f3addb60 (diff)
Merge pull request #337 from ueokande/e2e-test
e2e scroll test
Diffstat (limited to 'e2e/contents/tab.test.js')
-rw-r--r--e2e/contents/tab.test.js50
1 files changed, 28 insertions, 22 deletions
diff --git a/e2e/contents/tab.test.js b/e2e/contents/tab.test.js
index 198bf0a..707acef 100644
--- a/e2e/contents/tab.test.js
+++ b/e2e/contents/tab.test.js
@@ -18,31 +18,37 @@ describe("tab test", () => {
return windows.remove(targetWindow.id);
});
- 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);
- });
+ it('deletes tab by d', () => {
+ let before;
+ let targetTab;
+ return tabs.create(targetWindow.id, SERVER_URL).then((tab) => {
+ targetTab = tab;
+ return windows.get(targetWindow.id);
+ }).then((win) => {
+ before = win;
+ return keys.press(targetTab.id, 'd');
+ }).then(() => {
+ return windows.get(targetWindow.id);
+ }).then((actual) => {
+ expect(actual.tabs).to.have.lengthOf(before.tabs.length - 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);
- });
+ it('duplicates tab by zd', () => {
+ let before;
+ let targetTab;
+ return tabs.create(targetWindow.id, SERVER_URL).then((tab) => {
+ targetTab = tab;
+ return windows.get(targetWindow.id)
+ }).then((win) => {;
+ before = win;
+ return keys.press(targetTab.id, 'z');
+ }).then(() => {
+ return keys.press(targetTab.id, 'd');
+ }).then(() => {
+ return windows.get(targetWindow.id);
+ }).then((actual) => {
+ expect(actual.tabs).to.have.lengthOf(before.tabs.length + 1);
});
})
});