<commit_before>import { Observable } from 'rxjs';
import { NewFamilyRegistrationComponent } from './new-family-registration.component';
import { Router, ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router';
import { NewFamily, NewParent, NewChild } from '../../../../shared/models';
import * as moment from 'moment';

const event = {
  'EventTitle': 'Cool Event 83',
  'EventId': '92398420398',
};
const eventTitle = 'Cool Event';
let router;
let apiService = jasmine.createSpyObj('apiService', ['getEvent']);
let adminService = jasmine.createSpyObj('adminService', ['getGradeGroups']);
let headerService = jasmine.createSpyObj('headerService', ['announceEvent']);
let route: ActivatedRoute;
route = new ActivatedRoute();
route.snapshot = new ActivatedRouteSnapshot();
route.snapshot.params = { eventId: event.EventId };

fdescribe('NewFamilyRegistrationComponent', () => {
  it('#ngOnInit', () => {
    (<jasmine.Spy>(apiService.getEvent)).and.returnValue(Observable.of(event));
    (<jasmine.Spy>(adminService.getGradeGroups)).and.returnValue(Observable.of());
    let fixture = new NewFamilyRegistrationComponent(route, apiService, headerService, adminService, router);
    fixture.ngOnInit();
    expect(apiService.getEvent).toHaveBeenCalledWith(event.EventId);
    expect(adminService.getGradeGroups).toHaveBeenCalledWith(event.EventId);
    expect(headerService.announceEvent).toHaveBeenCalledWith(event);
  });

});<commit_msg>US5552: add tests<commit_after>import { Observable } from 'rxjs';
import { NewFamilyRegistrationComponent } from './new-family-registration.component';
import { Router, ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router';
import { NewFamily, NewParent, NewChild } from '../../../shared/models';
import * as moment from 'moment';

const event = {
  'EventTitle': 'Cool Event 83',
  'EventId': '92398420398',
};
const eventTitle = 'Cool Event';
let router;
let apiService = jasmine.createSpyObj('apiService', ['getEvent']);
let adminService = jasmine.createSpyObj('adminService', ['getGradeGroups']);
let headerService = jasmine.createSpyObj('headerService', ['announceEvent']);
let rootService;
let route: ActivatedRoute;
route = new ActivatedRoute();
route.snapshot = new ActivatedRouteSnapshot();
route.snapshot.params = { eventId: event.EventId };
let fixture;

fdescribe('NewFamilyRegistrationComponent', () => {
  beforeEach(() => {
    (<jasmine.Spy>(apiService.getEvent)).and.returnValue(Observable.of(event));
    (<jasmine.Spy>(adminService.getGradeGroups)).and.returnValue(Observable.of());
    fixture = new NewFamilyRegistrationComponent(route, apiService, headerService, adminService, rootService, router);
  });
  it('#ngOnInit', () => {
    spyOn(fixture, 'setUp');
    fixture.ngOnInit();
    expect(fixture.setUp).toHaveBeenCalled();
  });
  it('#setUp', () => {
    fixture.setUp();
    (<jasmine.Spy>(apiService.getEvent)).and.returnValue(Observable.of(event));
    expect(apiService.getEvent).toHaveBeenCalledWith(event.EventId);
    expect(adminService.getGradeGroups).toHaveBeenCalled();
    expect(headerService.announceEvent).toHaveBeenCalledWith(event);
  });
  // it('#updateNumberOfKids', () => {
  // });
  // it('#onSubmit', () => {
  // });

});
{'fraction_non_alphanumeric': 0.163107397090684, 'fraction_numerical': 0.009285051067780872, 'mean_word_length': 5.980561555075594, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 16, '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': '2898270', 'n_tokens_mistral': 998, 'n_tokens_neox': 967, 'n_words': 173}