1
- import { FormBuilder } from '@angular/forms' ;
2
- import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
3
- import { provideMockStore , MockStore } from '@ngrx/store/testing' ;
4
- import { HttpClientTestingModule } from '@angular/common/http/testing' ;
1
+ import { FormBuilder } from '@angular/forms' ;
2
+ import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
3
+ import { provideMockStore , MockStore } from '@ngrx/store/testing' ;
4
+ import { HttpClientTestingModule } from '@angular/common/http/testing' ;
5
5
6
- import { ProjectListHoverComponent } from './project-list-hover.component' ;
7
- import { ProjectState } from '../../../customer-management/components/projects/components/store/project.reducer' ;
8
- import { getCustomerProjects } from '../../../customer-management/components/projects/components/store/project.selectors' ;
9
- import { FilterProjectPipe } from '../../../shared/pipes' ;
10
- import { CreateEntry , UpdateActiveEntry } from '../../store/entry.actions' ;
6
+ import { ProjectListHoverComponent } from './project-list-hover.component' ;
7
+ import { ProjectState } from '../../../customer-management/components/projects/components/store/project.reducer' ;
8
+ import { getCustomerProjects } from '../../../customer-management/components/projects/components/store/project.selectors' ;
9
+ import { FilterProjectPipe } from '../../../shared/pipes' ;
10
+ import { CreateEntry , UpdateActiveEntry } from '../../store/entry.actions' ;
11
+ import { AutocompleteLibModule } from 'angular-ng-autocomplete' ;
11
12
12
13
describe ( 'ProjectListHoverComponent' , ( ) => {
13
14
let component : ProjectListHoverComponent ;
@@ -18,7 +19,7 @@ describe('ProjectListHoverComponent', () => {
18
19
const state = {
19
20
projects : {
20
21
projects : [ ] ,
21
- customerProjects : [ { id : 'id' , name : 'name' , description : 'description' , project_type_id : '123' } ] ,
22
+ customerProjects : [ { id : 'id' , name : 'name' , description : 'description' , project_type_id : '123' } ] ,
22
23
isLoading : false ,
23
24
message : '' ,
24
25
projectToEdit : undefined ,
@@ -38,8 +39,8 @@ describe('ProjectListHoverComponent', () => {
38
39
beforeEach ( async ( ( ) => {
39
40
TestBed . configureTestingModule ( {
40
41
declarations : [ ProjectListHoverComponent , FilterProjectPipe ] ,
41
- providers : [ FormBuilder , provideMockStore ( { initialState : state } ) ] ,
42
- imports : [ HttpClientTestingModule ] ,
42
+ providers : [ FormBuilder , provideMockStore ( { initialState : state } ) ] ,
43
+ imports : [ HttpClientTestingModule , AutocompleteLibModule ] ,
43
44
} ) . compileComponents ( ) ;
44
45
store = TestBed . inject ( MockStore ) ;
45
46
mockProjectsSelector = store . overrideSelector ( getCustomerProjects , state . projects ) ;
@@ -65,7 +66,7 @@ describe('ProjectListHoverComponent', () => {
65
66
} ) ;
66
67
67
68
it ( 'dispatchs a UpdateEntry action when activeEntry is not null' , ( ) => {
68
- const entry = { id : '123' , project_id : 'p1' , start_date : new Date ( ) . toISOString ( ) } ;
69
+ const entry = { id : '123' , project_id : 'p1' , start_date : new Date ( ) . toISOString ( ) } ;
69
70
component . activeEntry = entry ;
70
71
spyOn ( store , 'dispatch' ) ;
71
72
0 commit comments