diff --git a/test/unit/autocomplete.spec.coffee b/test/unit/autocomplete.spec.coffee index 937a1b5..15f1aac 100644 --- a/test/unit/autocomplete.spec.coffee +++ b/test/unit/autocomplete.spec.coffee @@ -98,6 +98,18 @@ describe "Mac autocomplete", -> expect($(".mac-menu-item").text() == "foo").toBe true + it "should use a callback function returned by an invoked function", -> + $rootScope.source = (val) -> + return (query, callback) -> callback [val] + + element = $compile("") $rootScope + $rootScope.$digest() + + changeInputValue element, "f" + $rootScope.$digest() + + expect($(".mac-menu-item").text() == "foo").toBe true + describe "label", -> it "should use default 'name' label", -> $rootScope.source = [