<commit_before>namespace common.models {

    let seededChance = new Chance(1);

    describe('User Model', () => {

        let userData:global.IUserData = UserMock.getMockData();

        it('should instantiate a new user', () => {

            let user = new User(_.clone(userData, true)); // We have to clone the user data so that we get a fresh copy for each test

            expect(user).to.be.instanceOf(User);

        });

        it('should return the user\'s full name', () => {

            let user = new User(_.clone(userData, true));

            expect(user.fullName()).to.equal(userData.firstName + ' ' + userData.lastName);

        });

        it('should be able to check if the user is an administrator', () => {

            userData.userType = 'admin';

            let user = new User(_.clone(userData, true));

            expect(user.isAdmin()).to.be.true;

        });

        it('should be able to check if the user has a social login', () => {

            let user = new User(_.clone(userData, true));

            let userLoginDataFacebook = new common.models.UserSocialLogin ({
                userId:user.userId,
                provider:common.models.UserSocialLogin.facebookType,
                token:seededChance.apple_token() // Closest thing to a token in Chance JS library
            });

            let userLoginDataGoogle = new common.models.UserSocialLogin ({
                userId:user.userId,
                provider:common.models.UserSocialLogin.googleType,
                token:seededChance.apple_token() // Closest thing to a token in Chance JS library
            });

            user._socialLogins.push(userLoginDataFacebook, userLoginDataGoogle);

            expect(user.hasSocialLogin(common.models.UserSocialLogin.facebookType)).to.be.true;

        });

        it('should be able to check if the user does not have a social login', () => {

            let user = new User(_.clone(userData, true));

            let userLoginDataGoogle = new common.models.UserSocialLogin({
                userId:user.userId,
                provider:common.models.UserSocialLogin.googleType,
                token:seededChance.apple_token() // Closest thing to a token in Chance JS library
            });

            user._socialLogins.push(userLoginDataGoogle);

            expect(user.hasSocialLogin(common.models.UserSocialLogin.facebookType)).to.be.false;

        });

    });

}<commit_msg>Filled hole in user mock service<commit_after>namespace common.models {

    let seededChance = new Chance(1);

    describe('User Model', () => {

        let userData:global.IUserData = UserMock.getMockData();

        it('should instantiate a new user', () => {

            let user = new User(_.clone(userData, true)); // We have to clone the user data so that we get a fresh copy for each test

            expect(user).to.be.instanceOf(User);

        });

        it('should get custom user mock entity', () => {

            let user = UserMock.entity({userId: 'abc-123'});

            expect(user).to.be.instanceOf(User);

            expect(user.userId).to.equal('abc-123');

        });

        it('should get user mock collection', () => {

            let users = UserMock.collection(5);

            expect(users).to.be.instanceOf(Array);

            expect(users).to.have.length(5);
        });

        it('should return the user\'s full name', () => {

            let user = new User(_.clone(userData, true));

            expect(user.fullName()).to.equal(userData.firstName + ' ' + userData.lastName);

        });

        it('should be able to check if the user is an administrator', () => {

            userData.userType = 'admin';

            let user = new User(_.clone(userData, true));

            expect(user.isAdmin()).to.be.true;

        });

        it('should be able to check if the user has a social login', () => {

            let user = new User(_.clone(userData, true));

            let userLoginDataFacebook = new common.models.UserSocialLogin ({
                userId:user.userId,
                provider:common.models.UserSocialLogin.facebookType,
                token:seededChance.apple_token() // Closest thing to a token in Chance JS library
            });

            let userLoginDataGoogle = new common.models.UserSocialLogin ({
                userId:user.userId,
                provider:common.models.UserSocialLogin.googleType,
                token:seededChance.apple_token() // Closest thing to a token in Chance JS library
            });

            user._socialLogins.push(userLoginDataFacebook, userLoginDataGoogle);

            expect(user.hasSocialLogin(common.models.UserSocialLogin.facebookType)).to.be.true;

        });

        it('should be able to check if the user does not have a social login', () => {

            let user = new User(_.clone(userData, true));

            let userLoginDataGoogle = new common.models.UserSocialLogin({
                userId:user.userId,
                provider:common.models.UserSocialLogin.googleType,
                token:<PASSWORD>.apple_token() // Closest thing to a token in Chance JS library
            });

            user._socialLogins.push(userLoginDataGoogle);

            expect(user.hasSocialLogin(common.models.UserSocialLogin.facebookType)).to.be.false;

        });

    });

}
{'fraction_non_alphanumeric': 0.11577181208053691, 'fraction_numerical': 0.0018642803877703207, 'mean_word_length': 2.10294968189705, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5618849', 'n_tokens_mistral': 1510, 'n_tokens_neox': 1393, 'n_words': 347}