Skip to content

Commit

Permalink
Merge pull request #59 from ORCID/testFixes
Browse files Browse the repository at this point in the history
Test fixes
  • Loading branch information
rcpeters authored May 2, 2017
2 parents b5a1893 + d1707fc commit 8cc509d
Show file tree
Hide file tree
Showing 11 changed files with 337 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"ng": "ng",
"start": "node server.js",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"test": "ng test --watch=false",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor",
"postinstall": "ng build -prod"
Expand Down
50 changes: 49 additions & 1 deletion src/app/add-id-error/add-id-error.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,62 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';
import { NgModule } from '@angular/core';

import { RouterTestingModule } from '@angular/router/testing';

import { AddIdErrorComponent } from './add-id-error.component';

import { Angular2FontAwesomeModule } from 'angular2-font-awesome/angular2-font-awesome';

import { AppComponent } from '../app.component';
import { AppRoutingModule } from '../app-routing.module';

import { CollectionService } from '../shared/collection/collection.service';
import { ConfigService } from '../shared/config/config.service';

import { AddIdSuccessComponent } from '../add-id-success/add-id-success.component';
import { CollectionEditComponent } from '../collection-edit/collection-edit.component';
import { CollectionShareComponent } from '../collection-share/collection-share.component';
import { OrcidUtilService } from '../shared/orcid-util/orcid-util.service';
import { FooterComponent } from '../footer/footer.component';
import { HeaderComponent } from '../header/header.component';
import { PageHomeComponent } from '../page-home/page-home.component';
import { CollectionEmailComponent } from '../collection-email/collection-email.component';


describe('AddIdErrorComponent', () => {
let component: AddIdErrorComponent;
let fixture: ComponentFixture<AddIdErrorComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddIdErrorComponent ]
declarations: [
AddIdSuccessComponent,
AddIdErrorComponent,
AppComponent,
CollectionEditComponent,
CollectionShareComponent,
FooterComponent,
HeaderComponent,
PageHomeComponent,
CollectionEmailComponent,
],
imports: [
Angular2FontAwesomeModule,
RouterTestingModule.withRoutes([]),
BrowserModule,
FormsModule,
HttpModule,
JsonpModule
],
providers: [
CollectionService,
ConfigService,
OrcidUtilService
],

})
.compileComponents();
}));
Expand Down
50 changes: 48 additions & 2 deletions src/app/add-id-success/add-id-success.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';
import { NgModule } from '@angular/core';

import { AddIdSuccessComponent } from './add-id-success.component';
import { RouterTestingModule } from '@angular/router/testing';

import { AddIdErrorComponent } from '../add-id-error/add-id-error.component';

import { Angular2FontAwesomeModule } from 'angular2-font-awesome/angular2-font-awesome';

import { AppComponent } from '../app.component';
import { AppRoutingModule } from '../app-routing.module';

import { CollectionService } from '../shared/collection/collection.service';
import { ConfigService } from '../shared/config/config.service';

import { AddIdSuccessComponent } from '../add-id-success/add-id-success.component';
import { CollectionEditComponent } from '../collection-edit/collection-edit.component';
import { CollectionShareComponent } from '../collection-share/collection-share.component';
import { OrcidUtilService } from '../shared/orcid-util/orcid-util.service';
import { FooterComponent } from '../footer/footer.component';
import { HeaderComponent } from '../header/header.component';
import { PageHomeComponent } from '../page-home/page-home.component';
import { CollectionEmailComponent } from '../collection-email/collection-email.component';

describe('AddIdSuccessComponent', () => {
let component: AddIdSuccessComponent;
let fixture: ComponentFixture<AddIdSuccessComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddIdSuccessComponent ]
declarations: [
AddIdSuccessComponent,
AddIdErrorComponent,
AppComponent,
CollectionEditComponent,
CollectionShareComponent,
FooterComponent,
HeaderComponent,
PageHomeComponent,
CollectionEmailComponent,
],
imports: [
Angular2FontAwesomeModule,
RouterTestingModule.withRoutes([]),
BrowserModule,
FormsModule,
HttpModule,
JsonpModule
],
providers: [
CollectionService,
ConfigService,
OrcidUtilService
],
})
.compileComponents();
}));
Expand Down
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');
}));
});
50 changes: 48 additions & 2 deletions src/app/collection-edit/collection-edit.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';
import { NgModule } from '@angular/core';

import { CollectionEditComponent } from './collection-edit.component';
import { RouterTestingModule } from '@angular/router/testing';

import { AddIdErrorComponent } from '../add-id-error/add-id-error.component';

import { Angular2FontAwesomeModule } from 'angular2-font-awesome/angular2-font-awesome';

import { AppComponent } from '../app.component';
import { AppRoutingModule } from '../app-routing.module';

import { CollectionService } from '../shared/collection/collection.service';
import { ConfigService } from '../shared/config/config.service';

import { AddIdSuccessComponent } from '../add-id-success/add-id-success.component';
import { CollectionEditComponent } from '../collection-edit/collection-edit.component';
import { CollectionShareComponent } from '../collection-share/collection-share.component';
import { OrcidUtilService } from '../shared/orcid-util/orcid-util.service';
import { FooterComponent } from '../footer/footer.component';
import { HeaderComponent } from '../header/header.component';
import { PageHomeComponent } from '../page-home/page-home.component';
import { CollectionEmailComponent } from '../collection-email/collection-email.component';

describe('CollectionEditComponent', () => {
let component: CollectionEditComponent;
let fixture: ComponentFixture<CollectionEditComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CollectionEditComponent ]
declarations: [
AddIdSuccessComponent,
AddIdErrorComponent,
AppComponent,
CollectionEditComponent,
CollectionShareComponent,
FooterComponent,
HeaderComponent,
PageHomeComponent,
CollectionEmailComponent,
],
imports: [
Angular2FontAwesomeModule,
RouterTestingModule.withRoutes([]),
BrowserModule,
FormsModule,
HttpModule,
JsonpModule
],
providers: [
CollectionService,
ConfigService,
OrcidUtilService
],
})
.compileComponents();
}));
Expand Down
51 changes: 48 additions & 3 deletions src/app/collection-email/collection-email.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,60 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';
import { NgModule } from '@angular/core';

import { CollectionEmailComponent } from './collection-email.component';
import { RouterTestingModule } from '@angular/router/testing';

import { AddIdErrorComponent } from '../add-id-error/add-id-error.component';

import { Angular2FontAwesomeModule } from 'angular2-font-awesome/angular2-font-awesome';

import { AppComponent } from '../app.component';
import { AppRoutingModule } from '../app-routing.module';

import { CollectionService } from '../shared/collection/collection.service';
import { ConfigService } from '../shared/config/config.service';

import { AddIdSuccessComponent } from '../add-id-success/add-id-success.component';
import { CollectionEditComponent } from '../collection-edit/collection-edit.component';
import { CollectionShareComponent } from '../collection-share/collection-share.component';
import { OrcidUtilService } from '../shared/orcid-util/orcid-util.service';
import { FooterComponent } from '../footer/footer.component';
import { HeaderComponent } from '../header/header.component';
import { PageHomeComponent } from '../page-home/page-home.component';
import { CollectionEmailComponent } from '../collection-email/collection-email.component';

describe('CollectionEmailComponent', () => {
let component: CollectionEmailComponent;
let fixture: ComponentFixture<CollectionEmailComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CollectionEmailComponent ]
})
declarations: [
AddIdSuccessComponent,
AddIdErrorComponent,
AppComponent,
CollectionEditComponent,
CollectionShareComponent,
FooterComponent,
HeaderComponent,
PageHomeComponent,
CollectionEmailComponent,
],
imports: [
Angular2FontAwesomeModule,
RouterTestingModule.withRoutes([]),
BrowserModule,
FormsModule,
HttpModule,
JsonpModule
],
providers: [
CollectionService,
ConfigService,
OrcidUtilService
], })
.compileComponents();
}));

Expand Down
50 changes: 48 additions & 2 deletions src/app/collection-share/collection-share.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';
import { NgModule } from '@angular/core';

import { CollectionShareComponent } from './collection-share.component';
import { RouterTestingModule } from '@angular/router/testing';

import { AddIdErrorComponent } from '../add-id-error/add-id-error.component';

import { Angular2FontAwesomeModule } from 'angular2-font-awesome/angular2-font-awesome';

import { AppComponent } from '../app.component';
import { AppRoutingModule } from '../app-routing.module';

import { CollectionService } from '../shared/collection/collection.service';
import { ConfigService } from '../shared/config/config.service';

import { AddIdSuccessComponent } from '../add-id-success/add-id-success.component';
import { CollectionEditComponent } from '../collection-edit/collection-edit.component';
import { CollectionShareComponent } from '../collection-share/collection-share.component';
import { OrcidUtilService } from '../shared/orcid-util/orcid-util.service';
import { FooterComponent } from '../footer/footer.component';
import { HeaderComponent } from '../header/header.component';
import { PageHomeComponent } from '../page-home/page-home.component';
import { CollectionEmailComponent } from '../collection-email/collection-email.component';

describe('CollectionShareComponent', () => {
let component: CollectionShareComponent;
let fixture: ComponentFixture<CollectionShareComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CollectionShareComponent ]
declarations: [
AddIdSuccessComponent,
AddIdErrorComponent,
AppComponent,
CollectionEditComponent,
CollectionShareComponent,
FooterComponent,
HeaderComponent,
PageHomeComponent,
CollectionEmailComponent,
],
imports: [
Angular2FontAwesomeModule,
RouterTestingModule.withRoutes([]),
BrowserModule,
FormsModule,
HttpModule,
JsonpModule
],
providers: [
CollectionService,
ConfigService,
OrcidUtilService
],
})
.compileComponents();
}));
Expand Down
Loading

0 comments on commit 8cc509d

Please sign in to comment.