-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Unit test passed, e2e failed * Basic draft of e2e test * Finished basic unit test and e2e test
- Loading branch information
Showing
7 changed files
with
130 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,76 @@ | ||
import { TestBed, async } from '@angular/core/testing'; | ||
|
||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { AppComponent } from './app.component'; | ||
import { HomeComponent } from './home'; | ||
import { LoginComponent } from './login'; | ||
|
||
import { LoginGuard } from './guard'; | ||
import { NotFoundComponent } from './not-found'; | ||
import { | ||
HeaderComponent, | ||
ApiCardComponent, | ||
FooterComponent, | ||
GithubComponent, | ||
} from './component'; | ||
|
||
import { | ||
MaterialModule | ||
} from '@angular/material'; | ||
|
||
|
||
import { | ||
ApiService, | ||
AuthService, | ||
UserService, | ||
FooService, | ||
ConfigService | ||
} from './service'; | ||
|
||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | ||
import { HttpModule } from '@angular/http'; | ||
|
||
describe('AppComponent', () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
AppComponent | ||
AppComponent, | ||
HeaderComponent, | ||
FooterComponent, | ||
], | ||
imports: [ | ||
RouterTestingModule, | ||
MaterialModule.forRoot(), | ||
//FormsModule, | ||
//ReactiveFormsModule, | ||
//HttpModule, | ||
|
||
], | ||
providers: [ | ||
ApiService, | ||
AuthService, | ||
UserService, | ||
FooService, | ||
ConfigService | ||
] | ||
}).compileComponents(); | ||
})); | ||
|
||
it('should create the app', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
let fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
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 have as title 'app works!'`, async(() => { | ||
// let 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); | ||
it('should render title in a span tag', async(() => { | ||
let fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
const compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain('app works!'); | ||
expect(compiled.querySelector('span').textContent).toContain('Angular-Spring-JWT-Starter'); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters