<commit_before>import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SpecimensSummaryComponent } from './specimens-summary.component';
import {HeaderComponent} from '../shared/header/header.component';
import {ChartsModule} from 'ng2-charts';
import {RouterTestingModule} from '@angular/router/testing';
import {HttpClientTestingModule} from '@angular/common/http/testing';

describe('SpecimensSummaryComponent', () => {
  let component: SpecimensSummaryComponent;
  let fixture: ComponentFixture<SpecimensSummaryComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        SpecimensSummaryComponent,
        HeaderComponent
      ],
      imports: [
        ChartsModule,
        RouterTestingModule,
        HttpClientTestingModule
      ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(SpecimensSummaryComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});<commit_msg>Adding unit test for specimens-summary component<commit_after>import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SpecimensSummaryComponent } from './specimens-summary.component';
import {HeaderComponent} from '../shared/header/header.component';
import {ChartsModule} from 'ng2-charts';
import {RouterTestingModule} from '@angular/router/testing';
import {HttpClientTestingModule} from '@angular/common/http/testing';

describe('SpecimensSummaryComponent', () => {
  let component: SpecimensSummaryComponent;
  let fixture: ComponentFixture<SpecimensSummaryComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        SpecimensSummaryComponent,
        HeaderComponent
      ],
      imports: [
        ChartsModule,
        RouterTestingModule,
        HttpClientTestingModule
      ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(SpecimensSummaryComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });

  it('should create data for charts', () => {
    const data = {
      sexSummary: [
        {
          name: 'male',
          value: 1
        }
      ],
      paperPublishedSummary: [
        {
          name: 'Yes',
          value: 1
        }
      ],
      standardSummary: [
        {
          name: 'FAANG',
          value: 1
        }
      ],
      cellTypeSummary: [
        {
          name: 'blood',
          value: 1
        }
      ],
      organismSummary: [
        {
          name: 'Bos taurus',
          value: 1
        }
      ],
      materialSummary: [
        {
          name: 'specimen from organism',
          value: 1
        }
      ],
      breedSummary: [
        {
          name: '<NAME>',
          value: [
            {
              name: 'Brahman',
              value: 1
            }
          ]
        }
      ]
    };
    component.assignChartData(data);
    expect(component.sexChartLabels).toEqual(['male']);
    expect(component.sexChartData).toEqual([1]);

    expect(component.paperChartLabels).toEqual(['Yes']);
    expect(component.paperChartData).toEqual([1]);

    expect(component.standardChartLabels).toEqual(['FAANG']);
    expect(component.standardChartData).toEqual([1]);

    expect(component.cellsChartLabels).toEqual(['blood']);
    expect(component.cellsChartData).toEqual([1]);

    expect(component.organismChartLabels).toEqual(['Bos taurus']);
    expect(component.organismChartData).toEqual([1]);

    expect(component.materialChartLabels).toEqual(['specimen from organism']);
    expect(component.materialChartData).toEqual([1]);

    expect(component.breedChartLabels).toEqual(['Brahman']);
    expect(component.standardChartData).toEqual([1]);
  });
});
{'fraction_non_alphanumeric': 0.13396889111891622, 'fraction_numerical': 0.004014049172102358, 'mean_word_length': 2.8189655172413794, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 15, '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': '4625814', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1086, 'n_words': 175}