Skip to content

Commit

Permalink
fix: fix checklist warining issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed May 1, 2020
1 parent 3baa736 commit 74884b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/presentation/checklists/checklists.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import { SharedModule } from '../../shared/shared.module';
import { LedgeRenderModule } from '@ledge-framework/render';
import { CustomMaterialModule } from '../../shared/custom-material.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ActivatedRoute, convertToParamMap } from '@angular/router';
import { ActivatedRoute, convertToParamMap, Router } from '@angular/router';
import { of } from 'rxjs';
import { RouterTestingModule } from '@angular/router/testing';

describe('ChecklistsComponent', () => {
let component: ChecklistsComponent;
let fixture: ComponentFixture<ChecklistsComponent>;
const mockRouter = {
navigate: jasmine.createSpy('navigate'),
};

beforeEach(async(() => {
TestBed.configureTestingModule({
Expand All @@ -24,6 +27,7 @@ describe('ChecklistsComponent', () => {
],
declarations: [ChecklistsComponent],
providers: [
{ provide: Router, useValue: mockRouter },
{
provide: ActivatedRoute,
useValue: {
Expand All @@ -48,6 +52,10 @@ describe('ChecklistsComponent', () => {

it('should change table', () => {
component.onTabChanged({ index: 1 } as any);
expect(mockRouter.navigate).toHaveBeenCalledWith([
'/checklists/',
'agile-practise',
]);
expect(component.selectedTabIndex).toEqual(1);
});
});

0 comments on commit 74884b0

Please sign in to comment.