Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# npm run build

# npm run test:coverage || {
# printf "\n\nERROR: Testing errors or coverage issues were found. Please address them before proceeding.\n\n\n\n"
# exit 1
# }
npm run test:coverage || {
printf "\n\nERROR: Testing errors or coverage issues were found. Please address them before proceeding.\n\n\n\n"
exit 1
}

# npm run test:check-coverage-thresholds || {
# printf "\n\nERROR: Coverage thresholds were not met. Please address them before proceeding.\n\n\n\n"
# exit 1
# }
npm run test:check-coverage-thresholds || {
printf "\n\nERROR: Coverage thresholds were not met. Please address them before proceeding.\n\n\n\n"
exit 1
}
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ module.exports = {
extensionsToTreatAsEsm: ['.ts'],
coverageThreshold: {
global: {
branches: 11.2,
functions: 11.34,
lines: 36.73,
statements: 37.33,
branches: 13.84,
functions: 14.33,
lines: 40.35,
statements: 40.9,
},
},
testPathIgnorePatterns: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Store } from '@ngxs/store';

import { TranslatePipe } from '@ngx-translate/core';
import { MockPipe, MockProvider } from 'ng-mocks';

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

import { RequestAccessComponent } from './request-access.component';

describe('RequestAccessComponent', () => {
describe.only('RequestAccessComponent', () => {
let component: RequestAccessComponent;
let fixture: ComponentFixture<RequestAccessComponent>;

const mockStore: jest.Mocked<Store> = {
dispatch: jest.fn().mockResolvedValue(undefined) as any,
select: jest.fn().mockReturnValue(of(undefined)) as any,
selectSnapshot: jest.fn() as any,
reset: jest.fn() as any,
} as any;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [RequestAccessComponent, MockPipe(TranslatePipe)],
Expand All @@ -27,6 +36,8 @@ describe('RequestAccessComponent', () => {
],
}).compileComponents();

TestBed.overrideProvider(Store, { useValue: mockStore });

fixture = TestBed.createComponent(RequestAccessComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
Loading