tasks: refactor listByTypePaged into list with options
this way we can list by prefix (coming commit)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user