Skip to content

Commit 740f0e6

Browse files
committed
fix tests
1 parent e7e45c4 commit 740f0e6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/client/tests/integration-tests/contentSearch.integration.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ test('Highlighting', async() => {
4242
.setTerm('highlighted')
4343
.highlighting(h => {
4444
h.setHighlightable({ dataKeys: ['Description'] })
45+
h.setLimit({ maxWordsBeforeMatch: 3 })
4546
// You have to specify to include the offset.
4647
// Currently offset is the only way to get a result, so if not set, you won't get a result.
4748
h.setShape({ includeOffsets: true, textSnippets: { includeTextSnippets: true, includeEllipses: true } })

packages/client/tests/integration-tests/productSearch.integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ test('ProductSearch with search constraint', async() => {
9797

9898
test('Highlighting', async() => {
9999
const request: ProductSearchRequest = baseProductBuilder()
100-
.setTerm('highlighted')
100+
.setTerm('SomeValue')
101101
.highlighting(h => {
102-
h.setHighlightable({ dataKeys: ['Description'] })
102+
h.setHighlightable({ dataKeys: ['SomeString'] })
103103
// You have to specify to include the offset.
104104
// Currently offset is the only way to get a result, so if not set, you won't get a result.
105105
h.setShape({ includeOffsets: true, textSnippets: { includeTextSnippets: true, includeEllipses: true } })
106106
}).build();
107107
const result = await searcher.searchProducts(request);
108108

109109
expect(result?.results![0].highlight?.offsets?.data[0].value.length).toBeGreaterThan(0);
110-
expect(result?.results![0].highlight?.snippets?.data[0].value[0]).toBe("...last word is highlighted");
110+
expect(result?.results![0].highlight?.snippets?.data[0].value[0]).toBe("SomeValue");
111111
})

0 commit comments

Comments
 (0)