<commit_before>path = require 'path'
{$} = require 'atom-space-pen-views'

describe "incompatible packages view", ->
  beforeEach ->
    jasmine.attachToDOM(atom.views.getView(atom.workspace))

    incompatiblePackage = atom.packages.loadPackage(path.join(__dirname, 'fixtures', 'incompatible-package'))
    spyOn(incompatiblePackage, 'isCompatible').andReturn(false)

    waitsForPromise ->
      atom.packages.activatePackage('status-bar')

    waitsForPromise ->
      atom.packages.activatePackage('incompatible-packages')

  it "opens a pane item when incompatible-packages:view is dispatched", ->
    expect(atom.workspace.getActivePaneItem()).toBeFalsy()

    atom.commands.dispatch(atom.views.getView(atom.workspace), 'incompatible-packages:view')

    waitsFor ->
      atom.workspace.getActivePaneItem()

  describe "when the status bar entry is clicked", ->
    it "opens the pane item", ->
      expect(atom.workspace.getActivePaneItem()).toBeFalsy()

      $('.incompatible-packages-status').click()

      waitsFor ->
        atom.workspace.getActivePaneItem()

      runs ->
        expect($('.incompatible-packages-status').length).toBe 0
<commit_msg>In spec, wait for status bar tile to show up<commit_after>path = require 'path'
{$} = require 'atom-space-pen-views'

describe "incompatible packages view", ->
  beforeEach ->
    jasmine.attachToDOM(atom.views.getView(atom.workspace))

    incompatiblePackage = atom.packages.loadPackage(path.join(__dirname, 'fixtures', 'incompatible-package'))
    spyOn(incompatiblePackage, 'isCompatible').andReturn(false)

    waitsForPromise ->
      atom.packages.activatePackage('status-bar')

    waitsForPromise ->
      atom.packages.activatePackage('incompatible-packages')

  it "opens a pane item when incompatible-packages:view is dispatched", ->
    expect(atom.workspace.getActivePaneItem()).toBeFalsy()

    atom.commands.dispatch(atom.views.getView(atom.workspace), 'incompatible-packages:view')

    waitsFor ->
      atom.workspace.getActivePaneItem()

  describe "when the status bar entry is clicked", ->
    statusBarItem = null

    it "opens the pane item", ->
      expect(atom.workspace.getActivePaneItem()).toBeFalsy()

      waitsFor ->
        statusBarItem = document.querySelector('.incompatible-packages-status')

      runs ->
        $(statusBarItem).click()

      waitsFor ->
        atom.workspace.getActivePaneItem()

      runs ->
        expect($('.incompatible-packages-status').length).toBe 0

{'fraction_non_alphanumeric': 0.1302250803858521, 'fraction_numerical': 0.0008038585209003215, 'mean_word_length': 3.795761078998073, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '5700240', 'n_tokens_mistral': 739, 'n_tokens_neox': 706, 'n_words': 125}