<commit_before>// Load the implementations that should be tested
import { CampaignBasicInfo } from './campaign-basic-info.component.ts';

describe('CampaignBasicInfo', () => {

  it('CampaignBasicInfo should be defined', function() {
    expect(CampaignBasicInfo).toBeDefined();
  });
});<commit_msg>testing functions of basic info component<commit_after>
// Load the implementations that should be tested
import { FormsModule } from '@angular/forms';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CampaignBasicInfo } from './campaign-basic-info.component.ts';
import { LanguageService } from '../../../services/language.service';

describe('CampaignBasicInfo', () => {
  let comp:    CampaignBasicInfo;
  let fixture: ComponentFixture<CampaignBasicInfo>;
  let lang: LanguageService;

  beforeEach(() => {
     TestBed.configureTestingModule({
       declarations: [ CampaignBasicInfo ], // declare the test component
       imports: [ FormsModule ],
       providers: [
           LanguageService
       ]
     });

     fixture = TestBed.createComponent(CampaignBasicInfo);

     comp = fixture.componentInstance; // CampaignBasicInfo test instance
     lang = new LanguageService();

   });

  it('Labels should have correct text value', () => {
    expect(comp.campaignNameLabel).toBe(lang.getWord('CAMPAIGN_NAME_LABEL'));
    expect(comp.campaignSubjectLabel).toBe(lang.getWord('CAMPAIGN_SUBJECT_LABEL'));
  });

  it('Changing campaign name should work', function() {
    comp.onNameChange('new name');
    expect(comp.campaignName).toBe('new name');
  });

  it('Getting campaign name should work', function() {
    comp.onNameChange('new name');
    expect(comp.getName()).toBe('new name');
  });

  it('Changing subject should work', function() {
    comp.onSubjectChange('new subject');
    expect(comp.campaignSubject).toBe('new subject');
  });

  it('Getting campaign subject should work', function() {
    comp.onSubjectChange('new subject');
    expect(comp.getSubject()).toBe('new subject');
  });

});
{'fraction_non_alphanumeric': 0.14348462664714495, 'fraction_numerical': 0.0, 'mean_word_length': 4.256410256410256, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, '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': '5741926', 'n_tokens_mistral': 570, 'n_tokens_neox': 548, 'n_words': 128}