Fix unit test

This commit is contained in:
Convly 2021-08-24 18:09:23 +02:00
parent 466161ca70
commit 8db5eabc80
2 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ describe('Entity service', () => {
expect(fakeStrapi.getModel).toHaveBeenCalledWith('test-model');
expect(fakeDB.query).toHaveBeenCalledWith('test-model');
expect(fakeQuery.findOne).toHaveBeenCalledWith({});
expect(fakeQuery.findOne).toHaveBeenCalledWith({ limit: 10 });
expect(result).toEqual(data);
});
});

View File

@ -23,7 +23,7 @@ const { MANY_RELATIONS } = relationsUtils.constants;
// TODO: those should be strapi events used by the webhooks not the other way arround
const { ENTRY_CREATE, ENTRY_UPDATE, ENTRY_DELETE } = webhookUtils.webhookEvents;
const paginateAndTransformToQuery = (uid, opts) => {
const paginateAndTransformToQuery = (uid, opts = {}) => {
// Paginate the opts
const paginatedOpts = paginationUtils.withDefaultPagination(opts);