<commit_before>/* globals $ */

'use strict';

describe('CMS.Messages', function () {
    fixture.setBase('cms/tests/frontend/unit/fixtures');

    it('creates a Messages class', function () {
        expect(CMS.Messages).toBeDefined();
    });

    it('has public api', function () {
        expect(CMS.Messages.prototype.open).toEqual(jasmine.any(Function));
        expect(CMS.Messages.prototype.close).toEqual(jasmine.any(Function));
    });

    describe('instance', function () {
        var messages;
        beforeEach(function (done) {
            $(function () {
                messages = new CMS.Messages();
                done();
            });
        });

        it('has ui', function () {
            expect(messages.ui).toEqual(jasmine.any(Object));
            expect(Object.keys(messages.ui)).toContain('container');
            expect(Object.keys(messages.ui)).toContain('body');
            expect(Object.keys(messages.ui)).toContain('toolbar');
            expect(Object.keys(messages.ui)).toContain('messages');
            expect(Object.keys(messages.ui).length).toEqual(4);
        });

        it('has options', function () {
            expect(messages.options).toEqual({
                messageDuration: 300,
                messageDelay: 3000
            });
            messages = new CMS.Messages({
                messageDuration: 100,
                messageDelay: 0
            });
            expect(messages.options).toEqual({
                messageDuration: 100,
                messageDelay: 0
            });
        });
    });<commit_msg>cache object.keys [ci skip]<commit_after>/* globals $ */

'use strict';

describe('CMS.Messages', function () {
    fixture.setBase('cms/tests/frontend/unit/fixtures');

    it('creates a Messages class', function () {
        expect(CMS.Messages).toBeDefined();
    });

    it('has public api', function () {
        expect(CMS.Messages.prototype.open).toEqual(jasmine.any(Function));
        expect(CMS.Messages.prototype.close).toEqual(jasmine.any(Function));
    });

    describe('instance', function () {
        var messages;
        beforeEach(function (done) {
            $(function () {
                messages = new CMS.Messages();
                done();
            });
        });

        it('has ui', function () {
            expect(messages.ui).toEqual(jasmine.any(Object));
            var keys = Object.keys(messages.ui);
            expect(keys).toContain('container');
            expect(keys).toContain('body');
            expect(keys).toContain('toolbar');
            expect(keys).toContain('messages');
            expect(keys.length).toEqual(4);
        });

        it('has options', function () {
            expect(messages.options).toEqual({
                messageDuration: 300,
                messageDelay: 3000
            });
            messages = new CMS.Messages({
                messageDuration: 100,
                messageDelay: 0
            });
            expect(messages.options).toEqual({
                messageDuration: 100,
                messageDelay: 0
            });
        });
    });
{'fraction_non_alphanumeric': 0.14797059763502718, 'fraction_numerical': 0.010226909555768616, 'mean_word_length': 1.8480436760691539, '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': '6071737', 'n_tokens_mistral': 860, 'n_tokens_neox': 795, 'n_words': 124}