From b8156a0c32a26f264466272a2d0d575a3517ea66 Mon Sep 17 00:00:00 2001 From: Sebastian Frysztak Date: Thu, 6 Oct 2016 21:02:15 +0200 Subject: [PATCH] BDD tests for :command-history-prev/next ref #999 --- tests/end2end/features/misc.feature | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index c24f0ea9f..7aaf82930 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -671,3 +671,38 @@ Feature: Various utility commands. And I wait until the scroll position changed And I run :click-element id link Then the error "Element position is out of view!" should be shown + + ## :command-history-{prev,next} + + Scenario: Calling previous command + When I run :set-cmd-text :message-info blah + And I run :command-accept + And I wait for "blah" in the log + And I run :set-cmd-text : + And I run :command-history-prev + And I run :command-accept + Then the message "blah" should be shown + + Scenario: Browsing through commands + When I run :set-cmd-text :message-info blarg + And I run :command-accept + And I wait for "blarg" in the log + And I run :set-cmd-text : + And I run :command-history-prev + And I run :command-history-prev + And I run :command-history-next + And I run :command-accept + Then the message "blarg" should be shown + + Scenario: Calling previous command when history is empty + Given I have a fresh instance + When I run :set-cmd-text : + And I run :command-history-prev + And I run :command-accept + Then the error "No command given" should be shown + + Scenario: Calling next command when there's no next command + When I run :set-cmd-text : + And I run :command-history-next + And I run :command-accept + Then the error "No command given" should be shown