Skip to content

Commit

Permalink
HARMONY-398: Add test with user filter
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyinverso committed Oct 11, 2023
1 parent 9c7f471 commit 81ce49b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/workflow-ui/job-table-rows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ describe('Workflow UI job table rows route', function () {
});
});

describe('who uses a user filter', function () {
hookWorkflowUIJobRows({ username: 'adam', jobIDs: [boJob1.jobID, boJob2.jobID],
query: { disallowUser: true, tableFilter: '[{"value":"user: bo","dbValue":"bo","field":"user"}]' } });
it('returns only the job row matching the user filter', function () {
const response = JSON.parse(this.res.text);
expect(response[boJob1.jobID]).to.eq(undefined);
expect(response[boJob2.jobID]).contains(undefined);
expect(Object.keys(response).length).to.eq(0);
});
});

describe('whose request includes someone else\'s job (but is an admin)', function () {
hookWorkflowUIJobRows({ username: 'adam', jobIDs: [boJob1.jobID, adamJob1.jobID] });
it('returns the other user\'s job rows in addition to their own', async function () {
Expand All @@ -72,7 +83,6 @@ describe('Workflow UI job table rows route', function () {
});
});


describe('who requests someone else\'s job (but is NOT an admin)', function () {
hookWorkflowUIJobRows({ username: 'bo', jobIDs: [adamJob1.jobID] });
it('returns undefined', async function () {
Expand Down

0 comments on commit 81ce49b

Please sign in to comment.