<commit_before>'use babel';

let remote = require('remote');
let dialog = remote.require('dialog');

describe("VideoPlayer", () => {
  let activationPromise = atom.packages.activatePackage('video-player');

  describe("when the video-player:start event is triggered", () => {
    beforeEach(() => {
      expect(atom.packages.isPackageActive('video-player')).toBe(false);

      runs(() => {
        activationPromise.fail((e) => console.log(e));
      });
    });

    it("then dialog opened", () => {
      let workspaceElement = atom.views.getView(atom.workspace);
      atom.commands.dispatch(workspaceElement, 'video-player:stop');
      waitsForPromise(() => activationPromise);

      let dialogOpened = false;
      let originalDialogOpen = dialog.showOpenDialog.bind(null);
      dialog.showOpenDialog = (...args) => {
        dialogOpened = true;
        return originalDialogOpen.call(dialog, ...args);
      };

      atom.commands.dispatch(workspaceElement, 'video-player:play');

      expect(dialogOpened).toBe(true);
    });
  });
});<commit_msg>fixed command for test<commit_after>'use babel';

let remote = require('remote');
let dialog = remote.require('dialog');

describe("VideoPlayer", () => {
  let activationPromise = atom.packages.activatePackage('video-player');

  describe("when the video-player:start event is triggered", () => {
    beforeEach(() => {
      expect(atom.packages.isPackageActive('video-player')).toBe(false);

      runs(() => {
        activationPromise.fail((e) => console.log(e));
      });
    });

    it("then dialog opened", () => {
      let workspaceElement = atom.views.getView(atom.workspace);
      atom.commands.dispatch(workspaceElement, 'video-player:stop');
      waitsForPromise(() => activationPromise);

      let dialogOpened = false;
      let originalDialogOpen = dialog.showOpenDialog.bind(null);
      dialog.showOpenDialog = (...args) => {
        dialogOpened = true;
        return originalDialogOpen.call(dialog, ...args);
      };

      atom.commands.dispatch(workspaceElement, 'video-player:play-in-new-tab');

      expect(dialogOpened).toBe(true);
    });
  });
});
{'fraction_non_alphanumeric': 0.16744402985074627, 'fraction_numerical': 0.0, 'mean_word_length': 3.478079331941545, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '4707319', 'n_tokens_mistral': 612, 'n_tokens_neox': 601, 'n_words': 101}