Skip to content

Commit

Permalink
SIMSBIOHUB-379: Added missing stub for intake endpoint test
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisupshall committed Dec 20, 2023
1 parent d5fca79 commit 4507700
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/src/paths/submission/intake.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ValidationService } from '../../services/validation-service';
import * as keycloakUtils from '../../utils/keycloak-utils';
import { getMockDBConnection, getRequestHandlerMocks } from '../../__mocks__/db';
import * as intake from './intake';

Check warning on line 11 in api/src/paths/submission/intake.test.ts

View workflow job for this annotation

GitHub Actions / Running Linter and Formatter

Delete `e';⏎import·{·SearchIndexService·}·from·'../../services/search-index-servic`
import { SearchIndexService } from '../../services/search-index-service';

chai.use(sinonChai);

Expand Down Expand Up @@ -95,6 +96,10 @@ describe('intake', () => {
.stub(SubmissionService.prototype, 'insertSubmissionFeatureRecords')
.resolves();

const indexFeaturesBySubmissionIdStub = sinon
.stub(SearchIndexService.prototype, 'indexFeaturesBySubmissionId')
.resolves();

const requestHandler = intake.submissionIntake();

const { mockReq, mockRes, mockNext } = getRequestHandlerMocks();
Expand All @@ -111,6 +116,7 @@ describe('intake', () => {
expect(validateSubmissionFeaturesStub).to.have.been.calledOnce;
expect(insertSubmissionRecordWithPotentialConflictStub).to.have.been.calledOnce;
expect(insertSubmissionFeatureRecordsStub).to.have.been.calledOnce;
expect(indexFeaturesBySubmissionIdStub).to.have.been.calledOnce;
expect(mockRes.statusValue).to.eql(200);
expect(mockRes.jsonValue).to.eql({ submission_id: 1 });
});
Expand Down

0 comments on commit 4507700

Please sign in to comment.