Skip to content

Commit 8aeeaf6

Browse files
committed
Fix custom highlight test
1 parent 8bb9abd commit 8aeeaf6

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

packages/autocomplete-client/src/search/__tests__/fetchMeilisearchResults.test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,25 @@ describe('fetchMeilisearchResults', () => {
5656
expect(results[0].hits[0].id).toEqual(SECOND_ITEM_ID)
5757
})
5858

59-
// test('with custom highlight tags', async () => {
60-
// const results = await fetchMeilisearchResults({
61-
// searchClient,
62-
// queries: [
63-
// {
64-
// indexName: INDEX_NAME,
65-
// query: 'Hit',
66-
// params: {
67-
// highlightPreTag: '<b>',
68-
// highlightPostTag: '</b>',
69-
// },
70-
// },
71-
// ],
72-
// })
59+
test('with custom highlight tags', async () => {
60+
const results = await fetchMeilisearchResults({
61+
searchClient,
62+
queries: [
63+
{
64+
indexName: INDEX_NAME,
65+
query: 'Ariel',
66+
params: {
67+
highlightPreTag: '<b>',
68+
highlightPostTag: '</b>',
69+
},
70+
},
71+
],
72+
})
7373

74-
// expect(results[0].hits[0]._highlightResult?.label?.value).toEqual(
75-
// '<b>Hit</b> 1'
76-
// )
77-
// })
74+
expect(results[0].hits[0]._highlightResult?.title?.value).toEqual(
75+
'<b>Ariel</b>'
76+
)
77+
})
7878

7979
// test('with highlighting metadata', async () => {
8080
// const results = await fetchMeilisearchResults({

0 commit comments

Comments
 (0)