tasks: refactor listByTypePaged into list with options

this way we can list by prefix (coming commit)
This commit is contained in:
Girish Ramakrishnan
2025-10-06 19:28:47 +02:00
parent d010330b58
commit b21d29098b
3 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -55,18 +55,18 @@ describe('task', function () {
});
it('list succeeds - does not exist', async function () {
const result = await tasks.listByTypePaged('randomtask', 1, 1);
const result = await tasks.list(1, 1, { type: 'randomtask' });
expect(result.length).to.be(0);
});
it('list succeeds - by type', async function () {
const result = await tasks.listByTypePaged(TASK.type, 1, 1);
const result = await tasks.list(1, 1, { type: TASK.type });
expect(result.length).to.be(1);
expect(_.pick(result[0], Object.keys(TASK))).to.eql(TASK);
});
it('list succeeds - all', async function () {
const result = await tasks.listByTypePaged(null, 1, 1);
const result = await tasks.list(1, 1, { type: null });
expect(result.length).to.be(1);
expect(_.pick(result[0], Object.keys(TASK))).to.eql(TASK);
});