it('should set `wasLastActionShow` variable to `true`', function () {
      var displaySwitch = new DisplaySwitch(200);
      displaySwitch.showDebounced = jasmine.createSpy('showDebounced');
      var range = { from: new CellCoords(0, 1) };

      displaySwitch.show(range);

      expect(displaySwitch.wasLastActionShow).toBe(true);
    });
    it('should call `showDebounced` function after triggering `show` function', function () {
      var displaySwitch = new DisplaySwitch(200);
      displaySwitch.showDebounced = jasmine.createSpy('showDebounced');
      var range = { from: new CellCoords(0, 1) };

      displaySwitch.show(range);

      expect(displaySwitch.showDebounced).toHaveBeenCalledWith(range);
    });
    it('should trigger `show` local hook after calling `show` function', function () {
      var displaySwitch = new DisplaySwitch(700);
      var onShow = jasmine.createSpy('onShow');
      var range = { from: new CellCoords(0, 1) };

      jest.useFakeTimers();

      displaySwitch.addLocalHook('show', onShow);
      displaySwitch.show(range);

      jest.runAllTimers();

      expect(onShow).toHaveBeenCalledWith(0, 1);
    });
    it('should not trigger `hide` local hook after calling `hide` function as not last one', function () {
      var displaySwitch = new DisplaySwitch(700);
      var onHide = jasmine.createSpy('onHide');
      var range = { from: new CellCoords(0, 1) };

      jest.useFakeTimers();

      displaySwitch.addLocalHook('hide', onHide);
      displaySwitch.hide();
      displaySwitch.show(range);

      jest.runAllTimers();

      expect(onHide).not.toHaveBeenCalled();
    });
    it('should update `showDebounced` function delay', function () {
      var displaySwitch = new DisplaySwitch(1000);
      var range = { from: new CellCoords(0, 1) };
      var cachedShowDebounced = jasmine.createSpy('cachedShowDebounced');
      displaySwitch.showDebounced = cachedShowDebounced;

      jest.useFakeTimers();

      displaySwitch.updateDelay(800);

      expect(cachedShowDebounced).not.toBe(displaySwitch.showDebounced);

      displaySwitch.show(range);
      jest.runAllTimers();

      expect(cachedShowDebounced).not.toHaveBeenCalled();
      expect(setTimeout.mock.calls.length).toBe(1);
      expect(setTimeout.mock.calls[0][1]).toBe(800);
    });