Unit testing angular directive - very stuck
I am having a ton of trouble testing my directive. Right now I am stuck with these two errors Test 'pbImagePicker template:should render HTML based on scope correctly' failed TypeError: 'undefined' is not a function (evaluating 'element.click') Test 'pbImagePicker element.click():should assign data from resolved promise when clicked' failed TypeError: 'undefined' is not a function (evaluating 'scope.$new(true)') Directive: angular.module('pb.campaigns.directives') .directive('pbImagePicker', ['$window', '$document', function ($window, $document) { return { restrict: "E", template: '<img data