Skip to content

Commit 7c49bda

Browse files
authored
Fix tests related to changes in placeholder hits order resolver (#737)
* Fix tests related to changes in Meilisearch * Update tests based on placeholder search resolution
1 parent 4ebc6e5 commit 7c49bda

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

tests/filter.tests.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ describe('Instant Meilisearch Browser test', () => {
104104
},
105105
])
106106
const hits = response.results[0].hits
107+
107108
expect(hits.length).toEqual(2)
108109
expect(hits[0].title).toEqual('Ariel')
109110
})
@@ -121,7 +122,7 @@ describe('Instant Meilisearch Browser test', () => {
121122
expect(hits[0].title).toEqual('Judgment Night')
122123
})
123124

124-
test('Test multiple nested on filter without a query', async () => {
125+
test('Test multiple nested array in filter without a query', async () => {
125126
const params = {
126127
indexName: 'movies',
127128
params: {
@@ -131,7 +132,7 @@ describe('Instant Meilisearch Browser test', () => {
131132
}
132133
const response = await searchClient.search<Movies>([params])
133134
const hits = response.results[0].hits
134-
expect(hits[0].title).toEqual('Kill Bill: Vol. 1')
135+
expect(hits[0].title).toEqual('Judgment Night')
135136
})
136137

137138
test('Test multiple nested arrays on filter with a query', async () => {

tests/highlight.tests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ describe('Highlight Browser test', () => {
8686

8787
const highlightedHit = response.results[0].hits[0]._highlightResult
8888
if (highlightedHit?.genres) {
89-
expect(highlightedHit?.genres[0]?.value).toEqual('Adventure')
90-
expect(highlightedHit?.genres[1]?.value).toEqual('Action')
89+
expect(highlightedHit?.genres[0]?.value).toEqual('Drama')
90+
expect(highlightedHit?.genres[1]?.value).toEqual('Crime')
9191
}
9292
})
9393

tests/pagination.tests.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ describe('Pagination browser test', () => {
3131
])
3232
const hits = response.results[0].hits
3333
expect(hits.length).toBe(1)
34-
expect(hits[0]?.title).toBe('Star Wars')
3534
})
3635

3736
test('Test 1 hitsPerPage w/ page 0 ', async () => {
@@ -48,7 +47,6 @@ describe('Pagination browser test', () => {
4847
const hits = response.results[0].hits
4948

5049
expect(hits.length).toBe(1)
51-
expect(hits[0].title).toBe('Star Wars')
5250
})
5351

5452
test('Test 1 hitsPerPage w/ page 1 ', async () => {
@@ -64,7 +62,6 @@ describe('Pagination browser test', () => {
6462
])
6563
const hits = response.results[0].hits
6664
expect(hits.length).toBe(1)
67-
expect(hits[0].title).toBe('Ariel')
6865
})
6966

7067
test('Test 100 hitsPerPage w/ page 1 ', async () => {

tests/snippets.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,6 @@ test('Test attributes to snippet on value smaller than the snippet size', async
324324
const hit = response.results[0].hits[0]._snippetResult
325325

326326
if (hit?.overview) {
327-
expect(hit?.title?.value).toEqual('Star Wars')
327+
expect(hit?.title?.value).toEqual('Ariel')
328328
}
329329
})

0 commit comments

Comments
 (0)