diff --git a/test/api/asset-query.spec.ts b/test/api/asset-query.spec.ts index ace3acc8..32427827 100644 --- a/test/api/asset-query.spec.ts +++ b/test/api/asset-query.spec.ts @@ -76,6 +76,24 @@ describe('AssetQuery API tests', () => { expect(result.assets[0].created_by).toBeDefined(); expect(result.assets[0].updated_by).toBeDefined(); }); + it('should check for limit', async () => { + const query = makeAssetQuery(); + const result = await query.limit(2).find(); + expect(query._queryParams).toEqual({limit: 2}); + expect(result.assets[0].uid).toBeDefined(); + expect(result.assets[0].content_type).toBeDefined(); + expect(result.assets[0].created_by).toBeDefined(); + expect(result.assets[0].updated_by).toBeDefined(); + }); + it.only('should check for skip', async () => { + const query = makeAssetQuery(); + const result = await query.skip(2).find(); + expect(query._queryParams).toEqual({skip: 2}); + expect(result.assets[0].uid).toBeDefined(); + expect(result.assets[0].content_type).toBeDefined(); + expect(result.assets[0].created_by).toBeDefined(); + expect(result.assets[0].updated_by).toBeDefined(); + }); }); function makeAssetQuery(): AssetQuery { const asset = stack.Asset(); diff --git a/test/api/entries.spec.ts b/test/api/entries.spec.ts index 6ce55115..eac3e0a1 100644 --- a/test/api/entries.spec.ts +++ b/test/api/entries.spec.ts @@ -56,6 +56,23 @@ describe('Entries API test cases', () => { expect(result.entries[0].uid).toBeDefined(); expect(result.entries[0].author).toBeDefined(); }); + it('should check for limit', async () => { + const query = makeEntries('blog_post'); + const result = await query.limit(2).find(); + expect(query._queryParams).toEqual({limit: 2}); + expect(result.entries[0]._version).toBeDefined(); + expect(result.entries[0].locale).toEqual('en-us'); + expect(result.entries[0].uid).toBeDefined(); + expect(result.entries[0].title).toBeDefined(); + }); + it.only('should check for skip', async () => { + const query = makeEntries('blog_post'); + const result = await query.skip(2).find(); + expect(query._queryParams).toEqual({skip: 2}); + expect(result.entries[0]._version).toBeDefined(); + expect(result.entries[0].uid).toBeDefined(); + expect(result.entries[0].title).toBeDefined(); + }); }); function makeEntries(contentTypeUid = ''): Entries { const entries = stack.ContentType(contentTypeUid).Entry();