<commit_before>import { ComponentFixture, async } from '@angular/core/testing';
import { TestUtils }               from '../../test-utils';
import { ClickerButton }           from './clickerButton';
import { ClickerMock }             from '../../models/clicker.mock';

let fixture: ComponentFixture<ClickerButton> = null;
let instance: any = null;

describe('ClickerButton', () => {

  beforeEach(async(() => TestUtils.beforeEachCompiler([ClickerButton]).then(compiled => {
    fixture = compiled.fixture;
    instance = compiled.instance;
    instance.clicker = new ClickerMock();
    fixture.detectChanges();
  })));

  afterEach(() => {
    fixture.destroy();
  });

  it('initialises', () => {
    expect(instance).not.toBeNull();
  });

  it('displays the clicker name and count', () => {
    fixture.detectChanges();
    expect(fixture.nativeElement.querySelectorAll('.button-inner')[0].innerHTML).toEqual('TEST CLICKER (10)');
  });

  it('does a click', async(() => {
    spyOn(instance['clickerService'], 'doClick');
    let button: any = fixture.debugElement.nativeElement.querySelector('button');
    button.click();

    fixture.whenStable().then(() => {
      expect(instance['clickerService'].doClick).toHaveBeenCalled();
    });
  }));
});
<commit_msg>reverting to old style, using async didn't achieve anything<commit_after>import { ComponentFixture, async } from '@angular/core/testing';
import { TestUtils }               from '../../test-utils';
import { ClickerButton }           from './clickerButton';
import { ClickerMock }             from '../../models/clicker.mock';

let fixture: ComponentFixture<ClickerButton> = null;
let instance: any = null;

describe('ClickerButton', () => {

  beforeEach(async(() => TestUtils.beforeEachCompiler([ClickerButton]).then(compiled => {
    fixture = compiled.fixture;
    instance = compiled.instance;
    instance.clicker = new ClickerMock();
    fixture.detectChanges();
  })));

  afterEach(() => {
    fixture.destroy();
  });

  it('initialises', () => {
    expect(instance).not.toBeNull();
  });

  it('displays the clicker name and count', () => {
    fixture.detectChanges();
    expect(fixture.nativeElement.querySelectorAll('.button-inner')[0].innerHTML).toEqual('TEST CLICKER (10)');
  });

  it('does a click', () => {
    fixture.detectChanges();
    spyOn(instance['clickerService'], 'doClick');
    TestUtils.eventFire(fixture.nativeElement.querySelectorAll('button')[0], 'click');
    expect(instance['clickerService'].doClick).toHaveBeenCalled();
  });
});

{'fraction_non_alphanumeric': 0.17888100866824272, 'fraction_numerical': 0.0027580772261623326, 'mean_word_length': 3.8546845124282982, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '2396861', 'n_tokens_mistral': 736, 'n_tokens_neox': 739, 'n_words': 130}