diff --git a/packages/server/__tests__/db/db.test.js b/packages/server/__tests__/db/db.test.js index 360f30866..7f4dfb091 100644 --- a/packages/server/__tests__/db/db.test.js +++ b/packages/server/__tests__/db/db.test.js @@ -62,13 +62,15 @@ describe('db', () => { costSharing: 'not a yes or no', agencyCode: 99, bill: 99, + opportunityCategories: ['Earmark', 'foo'], }; const errors = db.validateSearchFilters(badFilters); - expect(errors.length).to.equal(4); + expect(errors.length).to.equal(5); expect(errors[0]).to.equal('Received invalid filter opportunityNumber, expected String, received 99'); expect(errors[1]).to.equal('Received invalid filter costSharing, expected Enum, found value not a yes or no that is not in Yes,No'); expect(errors[2]).to.equal('Received invalid filter agencyCode, expected String, received 99'); expect(errors[3]).to.equal('Received invalid filter bill, expected String, received 99'); + expect(errors[4]).to.equal('Received invalid filter opportunityCategories, expected List of Enum, found value foo that is not in Other,Discretionary,Mandatory,Continuation,Earmark'); }); it('throws an error when Number filter-type is not a number', async () => { const badFilters = { diff --git a/packages/server/src/db/index.js b/packages/server/src/db/index.js index e748547f1..4fd5e4472 100755 --- a/packages/server/src/db/index.js +++ b/packages/server/src/db/index.js @@ -584,7 +584,7 @@ function validateSearchFilters(filters) { opportunityNumber: { type: 'String', valueType: 'Any' }, fundingTypes: { type: 'List', valueType: 'Enum', values: ['CA', 'G', 'PC', 'O'] }, opportunityStatuses: { type: 'List', valueType: 'Enum', values: ['posted', 'forecasted', 'closed', 'archived'] }, - opportunityCategories: { type: 'List', valueType: 'Enum', values: ['Other', 'Discretionary', 'Mandatory', 'Continuation'] }, + opportunityCategories: { type: 'List', valueType: 'Enum', values: ['Other', 'Discretionary', 'Mandatory', 'Continuation', 'Earmark'] }, costSharing: { type: 'String', valueType: 'Enum', values: ['Yes', 'No'] }, agencyCode: { type: 'String', valueType: 'Any' }, postedWithinDays: { type: 'number', valueType: 'Any' },