<commit_before>const $ = require('../../../BookReader/jquery-1.10.1.js');
require('../../../BookReader/jquery-ui-1.12.0.min.js');
require('../../../BookReader/jquery.browser.min.js');
require('../../../BookReader/dragscrollable-br.js');
require('../../../BookReader/jquery.colorbox-min.js');
require('../../../BookReader/jquery.bt.min.js');

require('../../../BookReader/BookReader.js');
require('../../../src/js/plugins/menu_toggle/plugin.menu_toggle.js');


let br;
let hideFlag;
beforeAll(() => {
  $.fx.off = true;
  const OGSpeed = $.speed;
  $.speed = function(_speed, easing, callback) {
    console.log('speed');
    return OGSpeed(0, easing, callback);
  };
  document.body.innerHTML = '<div id="BookReader">';
  br = new BookReader();
  br.init();
});

afterEach(() => {
  $.fx.off = false;
  jest.clearAllMocks();
});

describe('Plugin: Menu Toggle', () => {
  test('has option flag', () => {
    expect(BookReader.defaultOptions.enableMenuToggle).toEqual(true);
  });

  test('when bookreader loads, the menu shows', () => {
    expect($('.BRfooter').hasClass('js-menu-hide')).toEqual(false);
    expect($('.BRtoolbar').hasClass('js-menu-hide')).toEqual(false);
  })<commit_msg>add test to check for new animation consts<commit_after>const $ = require('../../../BookReader/jquery-1.10.1.js');
require('../../../BookReader/jquery-ui-1.12.0.min.js');
require('../../../BookReader/jquery.browser.min.js');
require('../../../BookReader/dragscrollable-br.js');
require('../../../BookReader/jquery.colorbox-min.js');
require('../../../BookReader/jquery.bt.min.js');

require('../../../BookReader/BookReader.js');
require('../../../src/js/plugins/menu_toggle/plugin.menu_toggle.js');


let br;
let hideFlag;
beforeAll(() => {
  $.fx.off = true;
  const OGSpeed = $.speed;
  $.speed = function(_speed, easing, callback) {
    console.log('speed');
    return OGSpeed(0, easing, callback);
  };
  document.body.innerHTML = '<div id="BookReader">';
  br = new BookReader();
  br.init();
});

afterEach(() => {
  $.fx.off = false;
  jest.clearAllMocks();
});

describe('Plugin: Menu Toggle', () => {
  test('has option flag', () => {
    expect(BookReader.defaultOptions.enableMenuToggle).toEqual(true);
  });

  test('core code has animation consts', () => {
    expect(BookReader.constNavAnimationDuration).toEqual(300);
    expect(BookReader.constResizeAnimationDuration).toEqual(100);
  })

  test('when bookreader loads, the menu shows', () => {
    expect($('.BRfooter').hasClass('js-menu-hide')).toEqual(false);
    expect($('.BRtoolbar').hasClass('js-menu-hide')).toEqual(false);
  })
{'fraction_non_alphanumeric': 0.24874662553027382, 'fraction_numerical': 0.009255688391824142, 'mean_word_length': 3.6156583629893237, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '131344', 'n_tokens_mistral': 857, 'n_tokens_neox': 858, 'n_words': 122}