<commit_before>{_, RootView} = require 'atom'
path = require 'path'

# Default to 30 second promises
waitsForPromise = (fn) -> window.waitsForPromise timeout: 30000, fn

describe 'ResultsView', ->
  [projectFindView, resultsView, searchPromise] = []

  beforeEach ->
    window.rootView = new RootView()
    project.setPath(path.join(__dirname, 'fixtures'))
    rootView.attachToDom()
    pack = atom.activatePackage("find-and-replace", immediate: true)
    projectFindView = pack.mainModule.projectFindView
    resultsView = projectFindView.resultsView

    spy = spyOn(projectFindView, 'confirm').andCallFake ->
      searchPromise = spy.originalValue.call(projectFindView)

    rootView.trigger 'project-find:show'

  describe "when list is scrollable", -><commit_msg>Set project path in results-view-spec<commit_after>path = require 'path'
{_, RootView} = require 'atom'
path = require 'path'

# Default to 30 second promises
waitsForPromise = (fn) -> window.waitsForPromise timeout: 30000, fn

describe 'ResultsView', ->
  [projectFindView, resultsView, searchPromise] = []

  beforeEach ->
    window.rootView = new RootView()
    project.setPath(path.join(__dirname, 'fixtures'))
    rootView.attachToDom()
    project.setPath(path.join(__dirname, 'fixtures'))
    pack = atom.activatePackage("find-and-replace", immediate: true)
    projectFindView = pack.mainModule.projectFindView
    resultsView = projectFindView.resultsView
    spy = spyOn(projectFindView, 'confirm').andCallFake ->
      searchPromise = spy.originalValue.call(projectFindView)

    rootView.trigger 'project-find:show'

  describe "when list is scrollable", ->
{'fraction_non_alphanumeric': 0.1182205971968312, 'fraction_numerical': 0.008531383302864107, 'mean_word_length': 4.623287671232877, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '6587111', 'n_tokens_mistral': 497, 'n_tokens_neox': 477, 'n_words': 108}