aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormrmr19932017-10-24 20:37:04 +0100
committermrmr19932017-10-27 20:34:59 +0100
commit183858066bfb9b710056b2cb3330f08f22e09361 (patch)
treefb4894cbcd061688421fdcacbd785f26ce9ca166 /tests
parentfe2255f4de5e17d6ab1a9168191bfbfaa488d62d (diff)
downloadvimium-183858066bfb9b710056b2cb3330f08f22e09361.tar.bz2
Add tests to check that foreground commands are implemented
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/commands_test.coffee16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/unit_tests/commands_test.coffee b/tests/unit_tests/commands_test.coffee
index 0e0be1d6..40afc1d7 100644
--- a/tests/unit_tests/commands_test.coffee
+++ b/tests/unit_tests/commands_test.coffee
@@ -3,6 +3,8 @@ extend global, require "./test_chrome_stubs.js"
extend global, require "../../background_scripts/bg_utils.js"
global.Settings = {postUpdateHooks: {}, get: (-> ""), set: ->}
{Commands} = require "../../background_scripts/commands.js"
+global.KeyHandlerMode = {}
+{NormalModeCommands} = require "../../content_scripts/mode_normal.js"
context "Key mappings",
setup ->
@@ -114,6 +116,14 @@ context "Parse commands",
assert.equal "a", BgUtils.parseLines(" a \n b")[0]
assert.equal "b", BgUtils.parseLines(" a \n b")[1]
-# TODO (smblott) More tests:
-# - Ensure each background command has an implmentation in BackgroundCommands
-# - Ensure each foreground command has an implmentation in vimium_frontent.coffee
+context "Commands implemented",
+ (for own command, options of Commands.availableCommands
+ do (command, options) ->
+ if options.background
+ should "#{command} (background command)", ->
+ # TODO: Import background_scripts/main.js and expose BackgroundCommands from there.
+ # assert.isTrue BackgroundCommands[command]
+ else
+ should "#{command} (foreground command)", ->
+ assert.isTrue NormalModeCommands[command]
+ )...