Skip to content

Commit

Permalink
refactor: add activated route
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcanay committed Jul 16, 2024
1 parent 2495cc6 commit 8d971e6
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ActivatedRoute } from '@angular/router';
import { of } from 'rxjs';
import { PlotLongitudinalComponent } from './plot-longitudinal.component';

describe('PlotLongitudinalComponent', () => {
Expand All @@ -8,10 +10,20 @@ describe('PlotLongitudinalComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [PlotLongitudinalComponent]
})
.compileComponents();

imports: [HttpClientTestingModule],
providers: [
{
provide: ActivatedRoute,
useValue: {
queryParams: of({
cohort: 'testCohort',
features: ['feature1', 'feature2'],
}),
},
},
],
}).compileComponents();

fixture = TestBed.createComponent(PlotLongitudinalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down

0 comments on commit 8d971e6

Please sign in to comment.