|
|
@@ -246,6 +246,15 @@ describe('buildElasticBody()', () => {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ it('collectionIds', () => {
|
|
|
+ const result = buildElasticBody({ collectionIds: ['1', '2'] }, searchConfig, CHANNEL_ID, LanguageCode.en);
|
|
|
+ expect(result.query).toEqual({
|
|
|
+ bool: {
|
|
|
+ filter: [CHANNEL_ID_TERM, LANGUAGE_CODE_TERM, { terms: { collectionIds: ['1', '2'] } }],
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
it('collectionSlug', () => {
|
|
|
const result = buildElasticBody(
|
|
|
{ collectionSlug: 'plants' },
|
|
|
@@ -262,6 +271,20 @@ describe('buildElasticBody()', () => {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ it('collectionSlugs', () => {
|
|
|
+ const result = buildElasticBody(
|
|
|
+ { collectionSlugs: ['plants', 'tree'] },
|
|
|
+ searchConfig,
|
|
|
+ CHANNEL_ID,
|
|
|
+ LanguageCode.en,
|
|
|
+ );
|
|
|
+ expect(result.query).toEqual({
|
|
|
+ bool: {
|
|
|
+ filter: [CHANNEL_ID_TERM, LANGUAGE_CODE_TERM, { terms: { collectionSlugs: ['plants', 'tree'] } }],
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
it('paging', () => {
|
|
|
const result = buildElasticBody(
|
|
|
{ skip: 20, take: 10 },
|