<commit_before>
// describe('TextInput ', () => {
//   it('true is true', () => expect(true).toBe(true));
// });
/**
 * Created by pratik on 1/12/17.
 */
import { AmexioTextInputComponent } from './textinput.component';
import { AmexioFormIconComponent } from '../icon/icon.component';
import { FormsModule } from '@angular/forms';
import { IconLoaderService } from '../../../index'
import { ComponentFixture, TestBed } from '@angular/core/testing';
describe('NUMBER INPUT', () => {

  let comp: AmexioTextInputComponent;
  let fixture: ComponentFixture<AmexioTextInputComponent>;
  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [FormsModule],
      declarations: [AmexioTextInputComponent, AmexioFormIconComponent],
      providers: [IconLoaderService]
    });
    fixture = TestBed.createComponent(AmexioTextInputComponent);
    comp = fixture.componentInstance;

    it('true is true', () => expect(true).toBe(true));
  });


  it('initialize innervalue', () => {
    comp.value = 'sagfaf';
    expect(comp['innerValue']).toEqual(comp.value);
  });

  //wrking 1- set errormsg
  it('set errormsg', () => {
    comp.errormsg = 'data incorect';
    expect(comp.helpInfoMsg).toEqual('data incorect<br/>');
  });

  it('get errormsg', () => {
    //  comp.errormsg='data incorect';
    expect(comp.errormsg).toEqual(comp._errormsg);
  });

  //working 2 get minerrormsg
  it('get minerrormsg', () => {
    // comp.minerrormsg="";
    comp.minerrormsg = 'trial';
    expect(comp.minerrormsg).toEqual(comp._minerrormsg);
  })

  //get pattern
  it('get pattern', () => {
    expect(comp.pattern).toEqual(comp._pattern);
  })

  //set pattern
  // it('set pattern', () => {

  //   let obj = new RegExp(comp.pattern);
  //   expect(comp.value).not.toEqual(null);
  //   expect(comp.regEx).toEqual(obj);
  //  })

  it('register on change', () => {
    let fn: any;
    comp.registerOnChange(fn);
    expect(comp['onChangeCallback']).toEqual(fn);
  })


  it('register on touched', () => {
    let fn: any;
    comp.registerOnTouched(fn);
    expect(comp['onTouchedCallback']).toEqual(fn);
  })


  //on focus()
  it('on focus()', () => {
    //comp.showToolTip=true;
    let flag = true;
    comp.onFocus();
    expect(comp.showToolTip).toEqual(flag);
  })

  //on blur()
  // it('on blur()', () => {
  //   comp.onBlur(fixture);
  //   expect(comp.showToolTip).toEqual(false);
  //   expect(comp.componentClass).toEqual(comp.validateClass(fixture));

  // })
  it('getCssClass()', () => {
    comp.getCssClass();
    expect(comp.getCssClass).toBeUndefined;
  });
  //working 3 get maxerrormsg
  it('get _maxerrormsg', () => {
    comp.maxerrormsg = 'trial';
    expect(comp.maxerrormsg).toEqual(comp._maxerrormsg);
  })<commit_msg>textinput:test case<commit_after>
// describe('TextInput ', () => {
//   it('true is true', () => expect(true).toBe(true));
// });
/**
 * Created by pratik on 1/12/17.
 */
import { AmexioTextInputComponent } from './textinput.component';
import { AmexioFormIconComponent } from '../icon/icon.component';
import { FormsModule } from '@angular/forms';
import { IconLoaderService } from '../../../index'
import { ComponentFixture, TestBed } from '@angular/core/testing';
describe('NUMBER INPUT', () => {

  let comp: AmexioTextInputComponent;
  let fixture: ComponentFixture<AmexioTextInputComponent>;
  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [FormsModule],
      declarations: [AmexioTextInputComponent, AmexioFormIconComponent],
      providers: [IconLoaderService]
    });
    fixture = TestBed.createComponent(AmexioTextInputComponent);
    comp = fixture.componentInstance;

    it('true is true', () => expect(true).toBe(true));
  });


  it('initialize innervalue', () => {
    comp.value = 'sagfaf';
    expect(comp['innerValue']).toEqual(comp.value);
  });

  //wrking 1- set errormsg
  it('set errormsg', () => {
    comp.errormsg = 'data incorect';
    expect(comp.helpInfoMsg).toEqual('data incorect<br/>');
  });

  it('get errormsg', () => {
    //  comp.errormsg='data incorect';
    expect(comp.errormsg).toEqual(comp._errormsg);
  });

  //working 2 get minerrormsg
  it('get minerrormsg', () => {
    // comp.minerrormsg="";
    comp.minerrormsg = 'trial';
    expect(comp.minerrormsg).toEqual(comp._minerrormsg);
  })

  //get pattern
  it('get pattern', () => {
    expect(comp.pattern).toEqual(comp._pattern);
  })

  //set pattern
  // it('set pattern', () => {

  //   let obj = new RegExp(comp.pattern);
  //   expect(comp.value).not.toEqual(null);
  //   expect(comp.regEx).toEqual(obj);
  //  })

  it('register on change', () => {
    let fn: any;
    comp.registerOnChange(fn);
    expect(comp['onChangeCallback']).toEqual(fn);
  })


  it('register on touched', () => {
    let fn: any;
    comp.registerOnTouched(fn);
    expect(comp['onTouchedCallback']).toEqual(fn);
  })
  it('writeValue()', () => {
    comp.writeValue(fixture);
    expect(comp.value).toEqual(fixture);
  });


  //on focus()
  it('on focus()', () => {
    //comp.showToolTip=true;
    let flag = true;
    comp.onFocus();
    expect(comp.showToolTip).toEqual(flag);
  })


  it('on blur()', () => {
    comp.onblur(fixture);
    expect(comp.showToolTip).toEqual(false);
    expect(comp.componentClass).toEqual(comp.validateComponent(fixture));

  })
  it('getCssClass()', () => {
    comp.getCssClass();
    expect(comp.getCssClass).toBeUndefined;
  });
  //working 3 get maxerrormsg
  it('get _maxerrormsg', () => {
    comp.maxerrormsg = 'trial';
    expect(comp.maxerrormsg).toEqual(comp._maxerrormsg);
  })
{'fraction_non_alphanumeric': 0.19056131569538792, 'fraction_numerical': 0.002860207365033965, 'mean_word_length': 3.490369181380417, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 42, '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': '6812081', 'n_tokens_mistral': 1925, 'n_tokens_neox': 1897, 'n_words': 298}