Skip to content

Commit 0fca651

Browse files
committed
feat(test-fixes): fixed a test
1 parent 48d0c39 commit 0fca651

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/app/core/components/request-access/request-access.component.spec.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { Store } from '@ngxs/store';
2+
13
import { TranslatePipe } from '@ngx-translate/core';
24
import { MockPipe, MockProvider } from 'ng-mocks';
35

@@ -12,10 +14,17 @@ import { ToastService } from '@osf/shared/services';
1214

1315
import { 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

Comments
 (0)