Skip to content

Commit e6e4951

Browse files
committed
fixed test cases by adding the correct imports
1 parent 77c71b3 commit e6e4951

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

client/src/app/dashboard/graph-view/graph-view.service.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import {TestBed} from '@angular/core/testing';
2-
2+
import { HttpClientTestingModule } from '@angular/common/http/testing';
33
import {GraphViewService} from './graph-view.service';
44

55
describe('GraphViewService', () => {
6-
beforeEach(() => TestBed.configureTestingModule({}));
6+
beforeEach(() => TestBed.configureTestingModule({
7+
imports: [HttpClientTestingModule],
8+
providers: [GraphViewService]
9+
}));
710

811
it('should be created', () => {
912
const service: GraphViewService = TestBed.get(GraphViewService);

client/src/app/dashboard/graph-view/graph-view/graph-view.component.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
22

33
import {GraphViewComponent} from './graph-view.component';
4+
import { ApiModule } from 'src/app/api/api.module';
5+
import { HttpClientModule } from '@angular/common/http';
6+
import { HttpClientTestingModule } from '@angular/common/http/testing';
47

58
describe('GraphViewComponent', () => {
69
let component: GraphViewComponent;
710
let fixture: ComponentFixture<GraphViewComponent>;
811

912
beforeEach(async(() => {
1013
TestBed.configureTestingModule({
11-
declarations: [GraphViewComponent]
14+
declarations: [GraphViewComponent],
15+
imports: [HttpClientTestingModule, HttpClientModule, ApiModule]
1216
})
1317
.compileComponents();
1418
}));

0 commit comments

Comments
 (0)