<commit_before>import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { By }              from '@angular/platform-browser';
import { Component, DebugElement }    from '@angular/core';
import { NavUserComponent } from './navuser.component';
import { Userinfo } from '../auth/userinfo.service';

@Component({
  selector: 'test-component',
  template: `<prx-navuser [userinfo]="userinfo">
        <h1 class="user-loading">IsLoading</h1>
        <h1 class="user-loaded">IsLoaded</h1>
      </prx-navuser>`
})
class TestComponent {
  userinfo: Userinfo;
}

describe('Component: NavUserComponent', () => {

  let comp: TestComponent;
  let fix: ComponentFixture<TestComponent>;
  let de: DebugElement;
  let el: HTMLElement;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [TestComponent, NavUserComponent]
    }).compileComponents().then(() => {

      fix = TestBed.createComponent(TestComponent);
      comp = fix.componentInstance;
      de = fix.debugElement;
      el = de.nativeElement;
    });
  }));

  it('displays the account name', () => {
    comp.userinfo = new Userinfo();
    comp.userinfo.preferred_username = 'Mary';
    fix.detectChanges();
    expect(de.query(By.css('.name')).nativeElement.innerText).toEqual('Mary');
  });

  it('displays the loaded content', () => {
    comp.userinfo = new Userinfo();
    comp.userinfo.preferred_username = 'Mary';
    fix.detectChanges();
    expect(el.innerText).toContain('IsLoaded');
  });

  it('displays loading content', () => {
    fix.detectChanges();
    expect(el.innerText).toContain('IsLoading');
  });

});
<commit_msg>Fix failing navuser test (userinfo key name changed, test not updated)<commit_after>import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { By }              from '@angular/platform-browser';
import { Component, DebugElement }    from '@angular/core';
import { NavUserComponent } from './navuser.component';
import { Userinfo } from '../auth/userinfo.service';

@Component({
  selector: 'test-component',
  template: `<prx-navuser [userinfo]="userinfo">
        <h1 class="user-loading">IsLoading</h1>
        <h1 class="user-loaded">IsLoaded</h1>
      </prx-navuser>`
})
class TestComponent {
  userinfo: Userinfo;
}

describe('Component: NavUserComponent', () => {

  let comp: TestComponent;
  let fix: ComponentFixture<TestComponent>;
  let de: DebugElement;
  let el: HTMLElement;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [TestComponent, NavUserComponent]
    }).compileComponents().then(() => {

      fix = TestBed.createComponent(TestComponent);
      comp = fix.componentInstance;
      de = fix.debugElement;
      el = de.nativeElement;
    });
  }));

  it('displays the account name', () => {
    comp.userinfo = new Userinfo();
    comp.userinfo.name = 'Mary';
    fix.detectChanges();
    expect(de.query(By.css('.name')).nativeElement.innerText).toEqual('Mary');
  });

  it('displays the loaded content', () => {
    comp.userinfo = new Userinfo();
    comp.userinfo.preferred_username = 'Mary';
    fix.detectChanges();
    expect(el.innerText).toContain('IsLoaded');
  });

  it('displays loading content', () => {
    fix.detectChanges();
    expect(el.innerText).toContain('IsLoading');
  });

});

{'fraction_non_alphanumeric': 0.16322252171308774, 'fraction_numerical': 0.002395926924228811, 'mean_word_length': 3.805755395683453, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 29, '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': '3957099', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1011, 'n_words': 196}