1
+ import { Store } from '@ngxs/store' ;
2
+
1
3
import { TranslatePipe } from '@ngx-translate/core' ;
2
4
import { MockPipe , MockProvider } from 'ng-mocks' ;
3
5
@@ -12,10 +14,17 @@ import { ToastService } from '@osf/shared/services';
12
14
13
15
import { RequestAccessComponent } from './request-access.component' ;
14
16
15
- describe ( 'RequestAccessComponent' , ( ) => {
17
+ describe . only ( 'RequestAccessComponent' , ( ) => {
16
18
let component : RequestAccessComponent ;
17
19
let fixture : ComponentFixture < RequestAccessComponent > ;
18
20
21
+ const mockStore : jest . Mocked < Store > = {
22
+ dispatch : jest . fn ( ) . mockResolvedValue ( undefined ) as any ,
23
+ select : jest . fn ( ) . mockReturnValue ( of ( undefined ) ) as any ,
24
+ selectSnapshot : jest . fn ( ) as any ,
25
+ reset : jest . fn ( ) as any ,
26
+ } as any ;
27
+
19
28
beforeEach ( async ( ) => {
20
29
await TestBed . configureTestingModule ( {
21
30
imports : [ RequestAccessComponent , MockPipe ( TranslatePipe ) ] ,
@@ -27,6 +36,8 @@ describe('RequestAccessComponent', () => {
27
36
] ,
28
37
} ) . compileComponents ( ) ;
29
38
39
+ TestBed . overrideProvider ( Store , { useValue : mockStore } ) ;
40
+
30
41
fixture = TestBed . createComponent ( RequestAccessComponent ) ;
31
42
component = fixture . componentInstance ;
32
43
fixture . detectChanges ( ) ;
0 commit comments