# all files / test/unit/base/module/ Fullscreen.spec.js

100% Statements 18/18
100% Branches 0/0
100% Functions 3/3
100% Lines 18/18

    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

    1×
    1×
    1×
    1×

    1×
    1×
    1×

    1×
    1×
    1×

    1×
    1×

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

     /**
     * Fullscreen.spec.js
     * (c) 2015~ Summernote Team
     * summernote may be freely distributed under the MIT license./
     */

    import chai from 'chai';
    import $ from 'jquery';
    import Context from '../../../../src/js/base/Context';
    import Fullscreen from '../../../../src/js/base/module/Fullscreen';

    describe('Fullscreen', () => {
      var expect = chai.expect;
      var fullscreen, context;

      beforeEach(() => {
        var options = $.extend({}, $.summernote.options);
        options.langInfo = $.extend(true, {
        }, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);
        context = new Context($('<div><p>hello</p></div>'), options);
        fullscreen = new Fullscreen(context);
      });

      it('should toggle fullscreen mode', () => {
        expect(fullscreen.isFullscreen()).to.be.false;
        fullscreen.toggle();
        expect(fullscreen.isFullscreen()).to.be.true;
        fullscreen.toggle();
        expect(fullscreen.isFullscreen()).to.be.false;
      });
    });