Skip to content

Commit

Permalink
lint & test
Browse files Browse the repository at this point in the history
  • Loading branch information
sshugsc committed Dec 16, 2024
1 parent 43941c3 commit 2c33756
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/routes/report/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ router.route('/')
.get(async (req, res) => {
let {
query: {
paginated, limit, offset, sort, project, states, role, searchText, keyVariant, matchingThreshold, kbVariant
paginated, limit, offset, sort, project, states, role, searchText, keyVariant, matchingThreshold, kbVariant,
},
} = req;

Expand All @@ -125,7 +125,7 @@ router.route('/')
try {
// validate request query parameters
validateAgainstSchema(reportGetSchema, {
paginated, limit, offset, sort, project, states, role, searchText, keyVariant, matchingThreshold, kbVariant
paginated, limit, offset, sort, project, states, role, searchText, keyVariant, matchingThreshold, kbVariant,
}, false);
} catch (err) {
const message = `Error while validating the query params of the report GET request ${err}`;
Expand Down
5 changes: 3 additions & 2 deletions test/routes/report/report.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe('/reports/{REPORTID}', () => {
const UNREVIEWED_ACCESS = 'unreviewed Access';

const KEYVARIANT = 'uniqueKeyVariant';
const KBVARIANT = 'uniqueKbVariant';

let project;
let project2;
Expand Down Expand Up @@ -503,7 +504,7 @@ describe('/reports/{REPORTID}', () => {

test('/ - kb match - 200 Success', async () => {
const res = await request
.get('/api/reports?category=unknown&variantType=cnv')
.get(`/api/reports?kbVariant=${KBVARIANT}&&matchingThreshold=1`)
.auth(username, password)
.type('json')
.expect(HTTP_STATUS.OK);
Expand All @@ -512,7 +513,7 @@ describe('/reports/{REPORTID}', () => {

for (const resReport of res.body.reports) {
for (const gAI of resReport.kbMatches) {
expect(gAI.variantType).toEqual('cnv');
expect(gAI.kbVariant).toEqual(KBVARIANT);
}
}
}, LONGER_TIMEOUT);
Expand Down

0 comments on commit 2c33756

Please sign in to comment.