Skip to content

Commit

Permalink
Fixed Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalshaikh42 committed Oct 29, 2019
1 parent f550249 commit 5d4245c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AccountMenuComponent } from './account-menu.component';
import { MaterialModule } from 'src/app/Modules/app-material.module';
import { RouterTestingModule } from '@angular/router/testing';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AccountMenuComponent ]
})
.compileComponents();
declarations: [AccountMenuComponent],
imports: [MaterialModule, RouterTestingModule],
}).compileComponents();
}));

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NavIconsComponent } from './nav-icons.component';
import { MaterialModule } from 'src/app/Modules/app-material.module';
import { RouterTestingModule } from '@angular/router/testing';
// TODO mock account menu
import { AccountMenuComponent } from '../account-menu/account-menu.component';

describe('NavIconsComponent', () => {
let component: NavIconsComponent;
Expand All @@ -12,7 +14,7 @@ describe('NavIconsComponent', () => {
TestBed.configureTestingModule({
imports: [MaterialModule, RouterTestingModule],
providers: [MaterialModule, RouterTestingModule],
declarations: [NavIconsComponent],
declarations: [NavIconsComponent, AccountMenuComponent],
}).compileComponents();
}));

Expand Down
2 changes: 1 addition & 1 deletion CRBM-Viz/src/app/Layout/nav-icons/nav-icons.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { AuthService } from 'src/app/Services/auth0.service';
import { AccountMenuComponent } from '../account-menu/account-menu.component';
import { AccountMenuComponent } from 'src/app/Layout/account-menu/account-menu.component';

@Component({
selector: 'app-nav-icons',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import { SearchBarComponent } from '../search-bar/search-bar.component';
import { FooterComponent } from '../footer/footer.component';
import { RouterTestingModule } from '@angular/router/testing';
import { MaterialModule } from 'src/app/Modules/app-material.module';

import { AccountMenuComponent } from '../account-menu/account-menu.component';
import { FilterPipe } from 'src/app/Pipes/filter.pipe';
import { SidebarComponent } from '../sidebar/sidebar.component';
// TODO Sample content is needed and component compiled with it as input for <ng-content>
import { AboutComponent } from 'src/app/Pages/about/about.component';
import { SidebarComponent } from '../sidebar/sidebar.component';

describe('NavigationComponent', () => {
let component: NavigationComponent;
let fixture: ComponentFixture<NavigationComponent>;
Expand All @@ -26,6 +28,8 @@ describe('NavigationComponent', () => {
SearchBarComponent,
FooterComponent,
SidebarComponent,
AccountMenuComponent,
FilterPipe,
],
imports: [MaterialModule, BrowserAnimationsModule, RouterTestingModule],
}).compileComponents();
Expand Down
8 changes: 4 additions & 4 deletions CRBM-Viz/src/app/Layout/sidebar/sidebar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SidebarComponent } from './sidebar.component';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterModule, Router, ActivatedRoute } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { from } from 'rxjs';
describe('LinksComponent', () => {
import { FilterPipe } from 'src/app/Pipes/filter.pipe';
describe('SidebarComponent', () => {
let component: SidebarComponent;
let fixture: ComponentFixture<SidebarComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [SidebarComponent],
declarations: [SidebarComponent, FilterPipe],
imports: [RouterTestingModule],
providers: [
{ provide: RouterTestingModule, useValue: RouterTestingModule },
Expand Down

0 comments on commit 5d4245c

Please sign in to comment.