1+ import { Store } from '@ngxs/store' ;
2+
13import { TranslatePipe } from '@ngx-translate/core' ;
24import { MockPipe , MockProvider } from 'ng-mocks' ;
35
@@ -12,10 +14,17 @@ import { ToastService } from '@osf/shared/services';
1214
1315import { RequestAccessComponent } from './request-access.component' ;
1416
15- describe ( 'RequestAccessComponent' , ( ) => {
17+ describe . only ( 'RequestAccessComponent' , ( ) => {
1618 let component : RequestAccessComponent ;
1719 let fixture : ComponentFixture < RequestAccessComponent > ;
1820
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+
1928 beforeEach ( async ( ) => {
2029 await TestBed . configureTestingModule ( {
2130 imports : [ RequestAccessComponent , MockPipe ( TranslatePipe ) ] ,
@@ -27,6 +36,8 @@ describe('RequestAccessComponent', () => {
2736 ] ,
2837 } ) . compileComponents ( ) ;
2938
39+ TestBed . overrideProvider ( Store , { useValue : mockStore } ) ;
40+
3041 fixture = TestBed . createComponent ( RequestAccessComponent ) ;
3142 component = fixture . componentInstance ;
3243 fixture . detectChanges ( ) ;
0 commit comments