From 66dcc391bab7145feb4b81ced0535c620876a0d6 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Wed, 10 Aug 2016 21:12:02 +1000 Subject: [PATCH] Add tests to check :undo opens in the old position --- tests/end2end/features/tabs.feature | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 42ad9152d..40c5215d4 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -703,6 +703,53 @@ Feature: Tab management Then the error "Nothing to undo!" should be shown And the error "Nothing to undo!" should be shown + Scenario: Undo a tab closed by index + When I open data/numbers/1.txt + And I open data/numbers/2.txt in a new tab + And I open data/numbers/3.txt in a new tab + And I run :tab-close with count 1 + And I run :undo + Then the following tabs should be open: + - data/numbers/1.txt (active) + - data/numbers/2.txt + - data/numbers/3.txt + + Scenario: Undo a tab closed after switching tabs + When I open data/numbers/1.txt + And I open data/numbers/2.txt in a new tab + And I open data/numbers/3.txt in a new tab + And I run :tab-close with count 1 + And I run :tab-focus 2 + And I run :undo + Then the following tabs should be open: + - data/numbers/1.txt (active) + - data/numbers/2.txt + - data/numbers/3.txt + + Scenario: Undo a tab closed after rearranging tabs + When I open data/numbers/1.txt + And I open data/numbers/2.txt in a new tab + And I open data/numbers/3.txt in a new tab + And I run :tab-close with count 1 + And I run :tab-focus 2 + And I run :tab-move with count 1 + And I run :undo + Then the following tabs should be open: + - data/numbers/1.txt (active) + - data/numbers/3.txt + - data/numbers/2.txt + + Scenario: Undo a tab closed after new tab opened + When I open data/numbers/1.txt + And I open data/numbers/2.txt in a new tab + And I run :tab-close with count 1 + And I open data/numbers/3.txt in a new tab + And I run :undo + Then the following tabs should be open: + - data/numbers/1.txt (active) + - data/numbers/2.txt + - data/numbers/3.txt + # last-close Scenario: last-close = blank