Code coverage report for test/base/module/LinkDialog.spec.js

# all files / test/base/module/ LinkDialog.spec.js

100% Statements 34/34
100% Branches 0/0
100% Functions 7/7
100% Lines 33/33

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    541×
    1×

    1×
    1×
    1×
    1×
    1×
    1×
    1×
    1×
    1×
    1×
    2×
    2×

    2×

    2×
    2×
    2×
    2×
    2×

    1×
    1×
    1×
    1×
    1×
    1×

    1×

    1×
    1×
    1×
    1×
    1×
    1×

     (function(global){global.wrappers['/Users/lqez/Dev/summernote/test/base/module/LinkDialog.spec.js']=[function(require,module,exports,__dirname,__filename){ "use strict";
    exports.__esModule = true;
    /**
     * LinkDialog.spec.js
     * (c) 2015~ Summernote Team
     * summernote may be freely distributed under the MIT license./
     */
    var chai_1 = require("chai");
    var jquery_1 = require("jquery");
    var range_1 = require("../../../src/js/base/core/range");
    var Context_1 = require("../../../src/js/base/Context");
    var LinkDialog_1 = require("../../../src/js/base/module/LinkDialog");
    require("../../../src/js/bs4/settings");
    describe('LinkDialog', function () {
        var expect = chai_1["default"].expect;
        var context, dialog, $editable;
        beforeEach(function () {
            var options = jquery_1["default"].extend({}, jquery_1["default"].summernote.options);
            options.toolbar = [
                ['insert', ['link']],
            ];
            context = new Context_1["default"](jquery_1["default"]('<div>' +
                '<p><a href="https://summernote.org/" target="_blank">hello</a></p>' +
                '<p><a href="https://summernote.org/">world</a></p>' +
                '</div>'), options);
            context.initialize();
            dialog = new LinkDialog_1["default"](context);
            dialog.initialize();
            $editable = context.layoutInfo.editable;
            $editable.appendTo('body');
        });
        describe('LinkDialog', function () {
            it('should check new window when target=_blank', function () {
                range_1["default"].createFromNode($editable.find('a')[0]).normalize().select();
                context.invoke('editor.setLastRange');
                dialog.show();
                var checked = dialog.$dialog
                    .find('.sn-checkbox-open-in-new-window input[type=checkbox]')
                    .is(':checked');
                expect(checked).to.be["true"];
            });
            it('should uncheck new window without target=_blank', function () {
                range_1["default"].createFromNode($editable.find('a')[1]).normalize().select();
                context.invoke('editor.setLastRange');
                dialog.show();
                var checked = dialog.$dialog.find('#sn-checkbox-open-in-new-window').is(':checked');
                expect(checked).to.be["false"];
            });
        });
    });

    },'test/base/module/LinkDialog.spec.js',{"chai":"/Users/lqez/Dev/summernote/node_modules/chai/index.js","jquery":"/Users/lqez/Dev/summernote/node_modules/jquery/dist/jquery.js","../../../src/js/base/core/range":"/Users/lqez/Dev/summernote/src/js/base/core/range.js","../../../src/js/base/Context":"/Users/lqez/Dev/summernote/src/js/base/Context.js","../../../src/js/base/module/LinkDialog":"/Users/lqez/Dev/summernote/src/js/base/module/LinkDialog.js","../../../src/js/bs4/settings":"/Users/lqez/Dev/summernote/src/js/bs4/settings.js"}];})(this);
    //# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 4708 characters]