<commit_before>/**
 * Test that we're able to add a custom type via the
 * addType method.
 */
describe('ngNotify addType method', function() {
    'use strict';

    var ngNotify,
        doc,
        element,
        scope;

    var message = 'Message to display during tests.';
    var newTypeName = 'notice';
    var newTypeClass = 'ngn-notice';

    /**
     * Setup our application before running each test.
     */

    beforeEach(module('ngNotify'));

    beforeEach(inject(function($injector, $document) {

        ngNotify = $injector.get('ngNotify');

        doc = $document;

        element = angular.element(
            document.querySelector('.ngn')
        );

        scope = element.scope();
    }));

    /**
     * Start from a clean slate between every single test.
     */

    afterEach(function() {
        doc.find('body').empty();
    });

    /**
     * Setup addType method tests.
     */

    it('string type notice is not set', function() {

        ngNotify.set(message, newTypeName);

        expect(
            scope.ngNotify.notifyClass.indexOf("ngn-" + newTypeName) > -1
        ).toBe(false);
    });

    it('object type notice is not set', function() {

        ngNotify.set(message, {
            type: newTypeName
        });

        expect(
            scope.ngNotify.notifyClass.indexOf("ngn-" + newTypeName) > -1
        ).toBe(false);
    });

    it('config type notice is not set', function() {

        ngNotify.config({
            type: newTypeName
        });

        ngNotify.set(message);

        expect(
            scope.ngNotify.notifyClass.indexOf("ngn-" + newTypeName) > -1
        ).toBe(false);
    });

    it('string type notice is set', function() {

        ngNotify.addType(newTypeName, newTypeClass);

        ngNotify.set(message, newTypeName);

        expect(
            scope.ngNotify.notifyClass.indexOf("ngn-" + newTypeName) > -1
        ).toBe(true);
    });

    it('object type notice is set', function() {

        ngNotify.addType(newTypeName, newTypeClass);

        ngNotify.set(message, {
            type: newTypeName
        });

        expect(
            scope.ngNotify.notifyClass.indexOf("ngn-" + newTypeName) > -1
        ).toBe(true);
    });

    it('config type notice is set', function() {

        ngNotify.addType(newTypeName, newTypeClass);

        ngNotify.config({
            type: newTypeName
        });

        ngNotify.set(message);

        expect(
            scope.ngNotify.notifyClass.indexOf("ngn-" + newTypeName) > -1
        ).toBe(true);
    });

});
<commit_msg>Update params for newType.<commit_after>/**
 * Test that we're able to add a custom type via the
 * addType method.
 */
describe('ngNotify addType method', function() {
    'use strict';

    var ngNotify,
        doc,
        element,
        scope;

    var message = 'Message to display during tests.';
    var newTypeName = 'notice';
    var newTypeClass = 'ngn-notice';

    /**
     * Setup our application before running each test.
     */

    beforeEach(module('ngNotify'));

    beforeEach(inject(function($injector, $document) {

        ngNotify = $injector.get('ngNotify');

        doc = $document;

        element = angular.element(
            document.querySelector('.ngn')
        );

        scope = element.scope();
    }));

    /**
     * Start from a clean slate between every single test.
     */

    afterEach(function() {
        doc.find('body').empty();
    });

    /**
     * Setup addType method tests.
     */

    it('string type notice is not set', function() {

        ngNotify.set(message, newTypeName);

        expect(
            scope.ngNotify.notifyClass.indexOf(newTypeClass) > -1
        ).toBe(false);
    });

    it('object type notice is not set', function() {

        ngNotify.set(message, {
            type: newTypeName
        });

        expect(
            scope.ngNotify.notifyClass.indexOf(newTypeClass) > -1
        ).toBe(false);
    });

    it('config type notice is not set', function() {

        ngNotify.config({
            type: newTypeName
        });

        ngNotify.set(message);

        expect(
            scope.ngNotify.notifyClass.indexOf(newTypeClass) > -1
        ).toBe(false);
    });

    it('string type notice is set', function() {

        ngNotify.addType(newTypeName, newTypeClass);

        ngNotify.set(message, newTypeName);

        expect(
            scope.ngNotify.notifyClass.indexOf(newTypeClass) > -1
        ).toBe(true);
    });

    it('object type notice is set', function() {

        ngNotify.addType(newTypeName, newTypeClass);

        ngNotify.set(message, {
            type: newTypeName
        });

        expect(
            scope.ngNotify.notifyClass.indexOf(newTypeClass) > -1
        ).toBe(true);
    });

    it('config type notice is set', function() {

        ngNotify.addType(newTypeName, newTypeClass);

        ngNotify.config({
            type: newTypeName
        });

        ngNotify.set(message);

        expect(
            scope.ngNotify.notifyClass.indexOf(newTypeClass) > -1
        ).toBe(true);
    });

});

{'fraction_non_alphanumeric': 0.13243612248878486, 'fraction_numerical': 0.0023405500292568754, 'mean_word_length': 1.9420539300057373, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7458505', 'n_tokens_mistral': 1515, 'n_tokens_neox': 1436, 'n_words': 327}