Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
Fixed testing issue
Browse files Browse the repository at this point in the history
Removed script to load github stars and forks.
Added routes for router testing module in dashboard content component
  • Loading branch information
sanketbansal committed Jun 8, 2019
1 parent fcb2ff3 commit 639df0f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,34 @@ import {RouterTestingModule} from '@angular/router/testing';
import {GlobalService} from '../../../services/global.service';
import {AuthService} from '../../../services/auth.service';
import {EndpointsService} from '../../../services/endpoints.service';
import {Routes} from '@angular/router';
import {NotFoundComponent} from '../../not-found/not-found.component';

const routes: Routes = [
{
path: '',
component: DashboardContentComponent,
},
{
path: '404',
component: NotFoundComponent
},
{
path: '**',
redirectTo: '/404',
pathMatch: 'full'
}
];

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

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DashboardContentComponent ],
declarations: [ DashboardContentComponent, NotFoundComponent ],
providers: [ApiService, GlobalService, AuthService, EndpointsService],
imports: [HttpClientModule, RouterTestingModule]
imports: [HttpClientModule, RouterTestingModule.withRoutes(routes)]
})
.compileComponents();
}));
Expand Down
6 changes: 0 additions & 6 deletions src/app/components/nav/footer/footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ export class FooterComponent implements OnInit {
}

this.year = new Date().getFullYear();
const js = this.document.createElement('script');
// js.src = (/^http:/.test(this.document.location) ? 'http' : 'https') + '://buttons.github.io/buttons.js';
console.log('logi: ' + this.document.location);
js.src = 'https://buttons.github.io/buttons.js';
this.document.getElementsByTagName('head')[0].appendChild(js);

}

/**
Expand Down

0 comments on commit 639df0f

Please sign in to comment.