<commit_before>﻿'use strict';
describe('loginController tests', function () {
    var scope, ctrl, authServices, location;

    function authServicesMock() {
        var mock = {
            succeed: true
        };

        mock.login = function() {
            return {
                then: function(r, e) {
                    if (mock.succeed) {
                        r();
                    } else {
                        e({ error_description: 'Error' });
                    }
                }
            }
        };
        return mock;
    };

    beforeEach(function() {
        module('AzureLinkboardApp');
        module('linkboardControllers');

        inject(function ($rootScope, $injector, $controller) {
            authServices = authServicesMock();
            location = $injector.get('$location');
            scope = $rootScope.$new();
            ctrl = $controller("loginController", {
                $scope: scope,
                $location: location,
                authService: authServices
            });
        });
    });
    
    it("should have empty login data", function () {
        expect(scope.loginData).toBeDefined();
        expect(scope.loginData.userName).toBe("");
        expect(scope.loginData.password).toBe("");
    });

    it("should start with an empty message", function () {
        expect(scope.message).toBe("");
    });

    it("login should go to links page", function () {
        scope.login();
        expect(location.path()).toBe('/links');
    });

    it("failed login should set message", function () {
        authServices.succeed = false;
        scope.login();
        expect(scope.message).toBe("Error");
    });
});<commit_msg>Test commit to see if a failing unit test breaks the build<commit_after>﻿'use strict';
describe('loginController tests', function () {
    var scope, ctrl, authServices, location;

    function authServicesMock() {
        var mock = {
            succeed: true
        };

        mock.login = function() {
            return {
                then: function(r, e) {
                    if (mock.succeed) {
                        r();
                    } else {
                        e({ error_description: 'Error' });
                    }
                }
            }
        };
        return mock;
    };

    beforeEach(function() {
        module('AzureLinkboardApp');
        module('linkboardControllers');

        inject(function ($rootScope, $injector, $controller) {
            authServices = authServicesMock();
            location = $injector.get('$location');
            scope = $rootScope.$new();
            ctrl = $controller("loginController", {
                $scope: scope,
                $location: location,
                authService: authServices
            });
        });
    });
    
    it("should have empty login data", function () {
        expect(scope.loginData).toBeDefined();
        expect(scope.loginData.userName).toBe("");
        expect(scope.loginData.password).toBe("");
    });

    it("should start with an empty message", function () {
        expect(scope.message).toBe("");
    });

    it("login should go to links page", function () {
        scope.login();
        expect(location.path()).toBe('/links');
    });

    it("failed login should set message", function () {
        authServices.succeed = false;
        scope.login();
        expect(scope.message).toBe("Error");
    });

    it("should break the build", function() {
        expect(false).toBeTruthy();
    });
});
{'fraction_non_alphanumeric': 0.1389983117613956, 'fraction_numerical': 0.0, 'mean_word_length': 1.6809954751131222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1460383', 'n_tokens_mistral': 907, 'n_tokens_neox': 875, 'n_words': 193}