diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit_tests/utils_test.coffee | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit_tests/utils_test.coffee b/tests/unit_tests/utils_test.coffee index 93849349..691b26ec 100644 --- a/tests/unit_tests/utils_test.coffee +++ b/tests/unit_tests/utils_test.coffee @@ -129,3 +129,23 @@ context "makeIdempotent", context "distinctCharacters", should "eliminate duplicate characters", -> assert.equal "abc", Utils.distinctCharacters "bbabaabbacabbbab" + +context "invokeCommandString", + setup -> + @beenCalled = false + window.singleComponentCommand = => @beenCalled = true + window.twoComponentCommand = command: window.singleComponentCommand + + tearDown -> + delete window.singleComponentCommand + delete window.twoComponentCommand + + should "invoke single-component commands", -> + assert.isFalse @beenCalled + Utils.invokeCommandString "singleComponentCommand" + assert.isTrue @beenCalled + + should "invoke multi-component commands", -> + assert.isFalse @beenCalled + Utils.invokeCommandString "twoComponentCommand.command" + assert.isTrue @beenCalled |
