aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2014-10-27 17:28:21 +0000
committerStephen Blott2014-10-27 17:28:21 +0000
commit139e61ada43441e9980a94bb960996014e633817 (patch)
treeeec2d51739945dae58f36aa0e45496f3d80dccfc
parent7765ff4f60a001238a734588786d7ea33edc2e3e (diff)
parentdc3379f0c193cc375a1b346be8756c031d943e87 (diff)
downloadvimium-139e61ada43441e9980a94bb960996014e633817.tar.bz2
Merge pull request #1199 from smblott-github/command-option-tests
Command tests - validate advanced commands
-rw-r--r--background_scripts/commands.coffee1
-rw-r--r--tests/unit_tests/commands_test.coffee14
2 files changed, 13 insertions, 2 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index 0ade35ec..10fa323b 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -117,6 +117,7 @@ Commands =
"LinkHints.activateModeToOpenInNewForegroundTab",
"LinkHints.activateModeWithQueue",
"LinkHints.activateModeToDownloadLink",
+ "LinkHints.activateModeToOpenIncognito",
"Vomnibar.activate",
"Vomnibar.activateInNewTab",
"Vomnibar.activateTabSelection",
diff --git a/tests/unit_tests/commands_test.coffee b/tests/unit_tests/commands_test.coffee
index a739884c..1fc5a95c 100644
--- a/tests/unit_tests/commands_test.coffee
+++ b/tests/unit_tests/commands_test.coffee
@@ -15,14 +15,16 @@ context "Key mappings",
context "Validate commands and options",
should "have either noRepeat or repeatLimit, but not both", ->
+ # TODO(smblott) For this and each following test, is there a way to structure the tests such that the name
+ # of the offending command appears in the output, if the test fails?
for command, options of Commands.availableCommands
assert.isTrue not (options.noRepeat and options.repeatLimit)
- should "have a description for each command", ->
+ should "describe each command", ->
for command, options of Commands.availableCommands
assert.equal 'string', typeof options.description
- should "have valid commands for each command in each command group", ->
+ should "define each command in each command group", ->
for group, commands of Commands.commandGroups
for command in commands
assert.equal 'string', typeof command
@@ -39,3 +41,11 @@ context "Validate commands and options",
for key, command of Commands.keyToCommandRegistry
assert.equal 'object', typeof command
assert.isTrue Commands.availableCommands[command.command]
+
+context "Validate advanced commands",
+ setup ->
+ @allCommands = [].concat.apply [], (commands for group, commands of Commands.commandGroups)
+
+ should "include each advanced command in a command group", ->
+ for command in Commands.advancedCommands
+ assert.isTrue 0 <= @allCommands.indexOf command