Skip to content

Commit 3e12351

Browse files
Add test for wildcard locale
1 parent bbe8082 commit 3e12351

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

server/src/__tests__/configuration.test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,34 @@ describe('Test Meilisearch plugin configurations', () => {
393393
expect(entries).toEqual([{ id: 1, locale: 'fr' }])
394394
})
395395

396+
test('Test should not remove any entries with wildcard locale', async () => {
397+
const customStrapi = createStrapiMock({
398+
restaurantConfig: {
399+
entriesQuery: {
400+
locale: '*',
401+
},
402+
},
403+
})
404+
405+
const contentType = 'restaurant'
406+
const meilisearchService = createMeilisearchService({
407+
strapi: customStrapi,
408+
})
409+
410+
const entries = meilisearchService.removeLocaleEntries({
411+
contentType,
412+
entries: [
413+
{ id: 1, locale: 'fr' },
414+
{ id: 2, locale: 'en' },
415+
],
416+
})
417+
418+
expect(entries).toEqual([
419+
{ id: 1, locale: 'fr' },
420+
{ id: 2, locale: 'en' },
421+
])
422+
})
423+
396424
test('Test should keep unpublished entries when status is set to draft', async () => {
397425
const customStrapi = createStrapiMock({
398426
restaurantConfig: {

0 commit comments

Comments
 (0)