{"size": 1012, "ext": "js", "max_stars_repo_path": "src/containers/AuthenticationProvider/useAutoSignOut/utils/resetTimer.test.js", "max_stars_repo_name": "HealthByRo/react-auth", "max_stars_repo_stars_event_min_datetime": "2020-07-21T19:43:24.000Z", "max_stars_repo_stars_event_max_datetime": "2020-07-21T19:43:24.000Z", "max_issues_repo_path": "src/containers/AuthenticationProvider/useAutoSignOut/utils/resetTimer.test.js", "max_issues_repo_name": "HealthByRo/react-auth", "max_issues_repo_issues_event_min_datetime": "2019-10-02T13:44:25.000Z", "max_issues_repo_issues_event_max_datetime": "2019-10-02T13:44:25.000Z", "max_forks_repo_path": "src/containers/AuthenticationProvider/useAutoSignOut/utils/resetTimer.test.js", "max_forks_repo_name": "HealthByRo/react-auth", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 24.6829268293, "max_line_length": 51, "alphanum_fraction": 0.581027668}
import runTimer from './runTimer';
import setLastActive from './setLastActive';
import resetTimer from './resetTimer';
import cancelTimer from './cancelTimer';
import { setTimer } from './timer';

jest.mock('./cancelTimer', () => jest.fn());
jest.mock('./runTimer', () => jest.fn());
jest.mock('./setLastActive', () => jest.fn());

describe('autoSignOut > resetTimer', () => {
  describe('when timer is not set', () => {
    beforeEach(() => {
      resetTimer();
    });

    it('does NOT call cancelTimer', () => {
      expect(cancelTimer).not.toHaveBeenCalled();
    });

    it('does NOT call setLastActive', () => {
      expect(setLastActive).not.toHaveBeenCalled();
    });

    it('does NOT call runTimer', () => {
      expect(runTimer).not.toHaveBeenCalled();
    });
  });

  describe('when timer is set', () => {
    beforeEach(() => {
      setTimer('FAKE_TIMER');
      resetTimer();
    });

    it('calls setLastActive', () => {
      expect(setLastActive).toHaveBeenCalled();
    });
  });
});
