Skip to content

Commit

Permalink
fix rest of the test
Browse files Browse the repository at this point in the history
  • Loading branch information
rcpeters committed May 2, 2017
1 parent 478243a commit a6c5500
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 12 deletions.
15 changes: 7 additions & 8 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { FooterComponent } from './footer/footer.component';
import { HeaderComponent } from './header/header.component';


import { AppComponent } from './app.component';

Expand All @@ -10,7 +13,9 @@ describe('AppComponent', () => {
RouterTestingModule
],
declarations: [
AppComponent
AppComponent,
FooterComponent,
HeaderComponent,
],
}).compileComponents();
}));
Expand All @@ -21,16 +26,10 @@ describe('AppComponent', () => {
expect(app).toBeTruthy();
}));

it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app works!');
}));

it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('app works!');
expect(compiled.querySelector('h1').textContent).toContain(' Share My ORCID iD');
}));
});
14 changes: 12 additions & 2 deletions src/app/shared/collection/collection.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import { TestBed, inject } from '@angular/core/testing';

import { HttpModule, JsonpModule } from '@angular/http';
import { OrcidUtilService } from '../../shared/orcid-util/orcid-util.service';
import { ConfigService } from '../../shared/config/config.service';
import { CollectionService } from './collection.service';

describe('CollectionService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [CollectionService]
imports: [
HttpModule,
JsonpModule
],
providers: [
CollectionService,
ConfigService,
OrcidUtilService
],
});
});

Expand Down
13 changes: 12 additions & 1 deletion src/app/shared/config/config.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { TestBed, inject } from '@angular/core/testing';
import { HttpModule, JsonpModule } from '@angular/http';
import { OrcidUtilService } from '../../shared/orcid-util/orcid-util.service';
import { CollectionService } from '../../shared/collection/collection.service';

import { ConfigService } from './config.service';

describe('ConfigService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [ConfigService]
imports: [
HttpModule,
JsonpModule
],
providers: [
CollectionService,
ConfigService,
OrcidUtilService
],
});
});

Expand Down
15 changes: 14 additions & 1 deletion src/app/shared/orcid-util/orcid-util.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import { TestBed, inject } from '@angular/core/testing';
import { HttpModule, JsonpModule } from '@angular/http';

import { OrcidUtilService } from './orcid-util.service';
import { CollectionService } from '../../shared/collection/collection.service';
import { ConfigService } from '../../shared/config/config.service';


describe('OrcidUtilService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [OrcidUtilService]
imports: [
HttpModule,
JsonpModule
],
providers: [
CollectionService,
ConfigService,
OrcidUtilService
],

});
});

Expand Down

0 comments on commit a6c5500

Please sign in to comment.