<commit_before>import React from 'react';
import {shallow, mount} from 'enzyme';

import FilePatchView from '../../lib/views/file-patch-view';
import Hunk from '../../lib/models/hunk';
import HunkLine from '../../lib/models/hunk-line';

import {assertEqualSets} from '../helpers';

describe('FilePatchView', function() {
  let atomEnv, commandRegistry, tooltips, component;
  let attemptLineStageOperation, attemptHunkStageOperation, discardLines, undoLastDiscard, openCurrentFile;
  let didSurfaceFile, didDiveIntoCorrespondingFilePatch;

  beforeEach(function() {
    atomEnv = global.buildAtomEnvironment();
    commandRegistry = atomEnv.commands;
    tooltips = atomEnv.tooltips;

    attemptLineStageOperation = sinon.spy();
    attemptHunkStageOperation = sinon.spy();
    discardLines = sinon.spy();
    undoLastDiscard = sinon.spy();
    openCurrentFile = sinon.spy();
    didSurfaceFile = sinon.spy();
    didDiveIntoCorrespondingFilePatch = sinon.spy();

    component = (
      <FilePatchView
        commandRegistry={commandRegistry}
        tooltips={tooltips}
        filePath="filename.js"
        hunks={[]}
        stagingStatus="unstaged"
        isPartiallyStaged={false}
        hasUndoHistory={false}
        attemptLineStageOperation={attemptLineStageOperation}
        attemptHunkStageOperation={attemptHunkStageOperation}
        discardLines={discardLines}
        undoLastDiscard={undoLastDiscard}
        openCurrentFile={openCurrentFile}
        didSurfaceFile={didSurfaceFile}
        didDiveIntoCorrespondingFilePatch={didDiveIntoCorrespondingFilePatch}
      />
    );
  });

  afterEach(function() {
    atomEnv.destroy();<commit_msg>Add spy to get rid of console error<commit_after>import React from 'react';
import {shallow, mount} from 'enzyme';

import FilePatchView from '../../lib/views/file-patch-view';
import Hunk from '../../lib/models/hunk';
import HunkLine from '../../lib/models/hunk-line';

import {assertEqualSets} from '../helpers';

describe('FilePatchView', function() {
  let atomEnv, commandRegistry, tooltips, component;
  let attemptLineStageOperation, attemptHunkStageOperation, discardLines, undoLastDiscard, openCurrentFile;
  let didSurfaceFile, didDiveIntoCorrespondingFilePatch, handleShowDiffClick;

  beforeEach(function() {
    atomEnv = global.buildAtomEnvironment();
    commandRegistry = atomEnv.commands;
    tooltips = atomEnv.tooltips;

    attemptLineStageOperation = sinon.spy();
    attemptHunkStageOperation = sinon.spy();
    discardLines = sinon.spy();
    undoLastDiscard = sinon.spy();
    openCurrentFile = sinon.spy();
    didSurfaceFile = sinon.spy();
    didDiveIntoCorrespondingFilePatch = sinon.spy();
    handleShowDiffClick = sinon.spy();

    component = (
      <FilePatchView
        commandRegistry={commandRegistry}
        tooltips={tooltips}
        filePath="filename.js"
        hunks={[]}
        stagingStatus="unstaged"
        isPartiallyStaged={false}
        hasUndoHistory={false}
        attemptLineStageOperation={attemptLineStageOperation}
        attemptHunkStageOperation={attemptHunkStageOperation}
        discardLines={discardLines}
        undoLastDiscard={undoLastDiscard}
        openCurrentFile={openCurrentFile}
        didSurfaceFile={didSurfaceFile}
        didDiveIntoCorrespondingFilePatch={didDiveIntoCorrespondingFilePatch}
        handleShowDiffClick={handleShowDiffClick}
      />
    );
  });

  afterEach(function() {
    atomEnv.destroy();
{'fraction_non_alphanumeric': 0.11056581986143187, 'fraction_numerical': 0.0, 'mean_word_length': 3.978448275862069, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4209618', 'n_tokens_mistral': 1018, 'n_tokens_neox': 985, 'n_words': 170}