angular unit test error

questionsangular unit test error
Shravan asked 2 years ago

hi
I am trying to unit test this function

$scope.showAddComponentOrig = function (ev) {
        var confirm = $mdDialog.confirm()
            .title('Choose Component to Add')
            .htmlContent(getAddComponentHtml($scope.tabs))
            .ariaLabel('Lucky day')
            .targetEvent(ev)
            .ok('Add')
            .cancel('Cancel');
        $mdDialog.show(confirm).then(function () {
            $scope.status = 'You decided to get rid of your debt.';
        }, function () {
            $scope.status = 'You decided to keep your debt.';
        });
    };

Here is my unit test code

    it('should open mdDialog', function () {
        scope.showAddComponentOrig ();
        scope.$digest();

        expect(mdDialog.show).toHaveBeenCalled();
        expect(scope.status).toBe('You decided to get rid of your debt.');
    });

I keep on seeing ReferenceError: getAddComponentHtml is not defined. Any ideas?