<commit_before>import { TestBed, ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Spinner } from './spinner';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

describe('Spinner', () => {
  
  let spinner: Spinner;
  let fixture: ComponentFixture<Spinner>;
  
  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        NoopAnimationsModule
      ],
      declarations: [
        Spinner
      ]
    });
    
    fixture = TestBed.createComponent(Spinner);
    spinner = fixture.componentInstance;
  });
});<commit_msg>spinner Testing<commit_after>import { TestBed, ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Spinner } from './spinner';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

describe('Spinner', () => {
  
  let spinner: Spinner;
  let fixture: ComponentFixture<Spinner>;
  
  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        NoopAnimationsModule
      ],
      declarations: [
        Spinner
      ]
    });
    
    fixture = TestBed.createComponent(Spinner);
    spinner = fixture.componentInstance;
  });
  
  const triggerEvent = (el, type) => {
    const e = document.createEvent('HTMLEvents');
    e.initEvent(type, false, true);
    el.dispatchEvent(e);
  };

  it('Should display the spinner value 3', () => {
    fixture.detectChanges();
    const spinnerUp = fixture.nativeElement.querySelector('.ui-spinner-up');
    triggerEvent(spinnerUp, 'mousedown');
    fixture.detectChanges();
    triggerEvent(spinnerUp, 'mousedown');
    fixture.detectChanges();
    triggerEvent(spinnerUp, 'mousedown');
    fixture.detectChanges();

     expect(spinner.valueAsString).toEqual('3');
  });

  it('Should display the spinner value -3', () => {
    fixture.detectChanges();
    const spinnerDown = fixture.nativeElement.querySelector('.ui-spinner-down');
    triggerEvent(spinnerDown, 'mousedown');
    fixture.detectChanges();
    triggerEvent(spinnerDown, 'mousedown');
    fixture.detectChanges();
    triggerEvent(spinnerDown, 'mousedown');
    fixture.detectChanges();

     expect(spinner.valueAsString).toEqual('-3');
  });
  
  it('Should display the spinner value 0.75  ', () => {
    spinner.step = 0.25;
    fixture.detectChanges();

    const spinnerUp = fixture.nativeElement.querySelector('.ui-spinner-up');
    triggerEvent(spinnerUp, 'mousedown');
    fixture.detectChanges();
    triggerEvent(spinnerUp, 'mousedown');
    fixture.detectChanges();
    triggerEvent(spinnerUp, 'mousedown');
    fixture.detectChanges();
    expect(spinner.valueAsString).toEqual('0.75');
  });
  it('Should display the spinner value -0.75', () => {
    spinner.step = 0.25;
    fixture.detectChanges();

    const spinnerDown = fixture.nativeElement.querySelector('.ui-spinner-down');
    triggerEvent(spinnerDown, 'mousedown');
    fixture.detectChanges();
    triggerEvent(spinnerDown, 'mousedown');
    fixture.detectChanges();
    triggerEvent(spinnerDown, 'mousedown');
    fixture.detectChanges();

     expect(spinner.valueAsString).toEqual('-0.75');
  });
});
{'fraction_non_alphanumeric': 0.1476175646216132, 'fraction_numerical': 0.006851448146994706, 'mean_word_length': 3.7868852459016393, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '358353', 'n_tokens_mistral': 991, 'n_tokens_neox': 982, 'n_words': 164}