This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 09a7b75d authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Fixing Tests

parent 9e3c5ecb
2 merge requests!17Initial Merge to Prepare Release 1.0.0,!1Resolve "Metadaten konsolideren"
...@@ -6,6 +6,8 @@ import { ProfileInfo } from 'app/layouts/profiles/profile-info.model'; ...@@ -6,6 +6,8 @@ import { ProfileInfo } from 'app/layouts/profiles/profile-info.model';
import { NavbarComponent } from 'app/layouts/navbar/navbar.component'; import { NavbarComponent } from 'app/layouts/navbar/navbar.component';
import { AccountService } from 'app/core/auth/account.service'; import { AccountService } from 'app/core/auth/account.service';
import { ProfileService } from 'app/layouts/profiles/profile.service'; import { ProfileService } from 'app/layouts/profiles/profile.service';
import { SearchService } from 'app/search/service/search-service'
import { FormBuilder } from '@angular/forms';
describe('Component Tests', () => { describe('Component Tests', () => {
describe('Navbar Component', () => { describe('Navbar Component', () => {
...@@ -13,11 +15,14 @@ describe('Component Tests', () => { ...@@ -13,11 +15,14 @@ describe('Component Tests', () => {
let fixture: ComponentFixture<NavbarComponent>; let fixture: ComponentFixture<NavbarComponent>;
let accountService: AccountService; let accountService: AccountService;
let profileService: ProfileService; let profileService: ProfileService;
let searchService: SearchService;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [GitsearchTestModule], imports: [GitsearchTestModule],
declarations: [NavbarComponent], declarations: [NavbarComponent],
providers: [
FormBuilder
],
}) })
.overrideTemplate(NavbarComponent, '') .overrideTemplate(NavbarComponent, '')
.compileComponents(); .compileComponents();
...@@ -28,6 +33,7 @@ describe('Component Tests', () => { ...@@ -28,6 +33,7 @@ describe('Component Tests', () => {
comp = fixture.componentInstance; comp = fixture.componentInstance;
accountService = TestBed.get(AccountService); accountService = TestBed.get(AccountService);
profileService = TestBed.get(ProfileService); profileService = TestBed.get(ProfileService);
searchService = TestBed.get(SearchService);
}); });
it('Should call profileService.getProfileInfo on init', () => { it('Should call profileService.getProfileInfo on init', () => {
...@@ -48,5 +54,16 @@ describe('Component Tests', () => { ...@@ -48,5 +54,16 @@ describe('Component Tests', () => {
// THEN // THEN
expect(accountService.isAuthenticated).toHaveBeenCalled(); expect(accountService.isAuthenticated).toHaveBeenCalled();
}); });
/* TODO later
it('Should call searchService.searchPageDetails on search changed', () => {
// WHEN
comp.searchChanged();
// THEN
expect(searchService.searchPageDetails).toHaveBeenCalled();
});
*/
}); });
}); });
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment