Skip to content

Commit

Permalink
Update tests according to new relevancy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
curquiza committed Jun 5, 2024
1 parent 8f019ac commit 4b499d4
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions src/test/java/com/meilisearch/integration/SearchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public void testSearchHighlight() throws Exception {

assertThat(resGson.hits, is(arrayWithSize(20)));
assertThat(
resGson.hits[0].getFormatted().getTitle(),
resGson.hits[3].getFormatted().getTitle(),
is(
equalTo(
"Birds of Prey (<em>and</em> the Fantabulous Emancipation of One Harley Quinn)")));
Expand Down Expand Up @@ -296,7 +296,7 @@ public void testSearchWithCustomizedHighlight() throws Exception {

assertThat(resGson.hits, is(arrayWithSize(20)));
assertThat(
resGson.hits[0].getFormatted().getTitle(),
resGson.hits[3].getFormatted().getTitle(),
is(
equalTo(
"Birds of Prey ((⊃。•́‿•̀。)⊃ and ⊂(´• ω •`⊂) the Fantabulous Emancipation of One Harley Quinn)")));
Expand Down Expand Up @@ -526,15 +526,13 @@ public void testRawSearchSort() throws Exception {
Results resGson = jsonGson.decode(index.rawSearch(searchRequest), Results.class);

assertThat(resGson.hits, is(arrayWithSize(20)));
assertThat(resGson.hits[0].getId(), is(equalTo("495764")));
assertThat(resGson.hits[0].getId(), is(equalTo("38700")));
assertThat(
resGson.hits[0].getTitle(),
is(
equalTo(
"Birds of Prey (and the Fantabulous Emancipation of One Harley Quinn)")));
assertThat(resGson.hits[1].getId(), is(equalTo("671")));
is(equalTo("Bad Boys for Life")));
assertThat(resGson.hits[2].getId(), is(equalTo("671")));
assertThat(
resGson.hits[1].getTitle(),
resGson.hits[2].getTitle(),
is(equalTo("Harry Potter and the Philosopher's Stone")));
}

Expand All @@ -561,16 +559,10 @@ public void testRawSearchSortWithIntParameter() throws Exception {
Results resGson = jsonGson.decode(index.rawSearch(searchRequest), Results.class);

assertThat(resGson.hits, is(arrayWithSize(20)));
assertThat(resGson.hits[0].getId(), is(equalTo("671")));
assertThat(
resGson.hits[0].getTitle(),
is(equalTo("Harry Potter and the Philosopher's Stone")));
assertThat(resGson.hits[1].getId(), is(equalTo("495764")));
assertThat(
resGson.hits[1].getTitle(),
is(
equalTo(
"Birds of Prey (and the Fantabulous Emancipation of One Harley Quinn)")));
assertThat(resGson.hits[0].getId(), is(equalTo("38700")));
assertThat(resGson.hits[0].getTitle(), is(equalTo("Bad Boys for Life")));
assertThat(resGson.hits[1].getId(), is(equalTo("671")));
assertThat(resGson.hits[1].getTitle(), is(equalTo("Harry Potter and the Philosopher's Stone")));
}

/** Test search sort */
Expand Down

0 comments on commit 4b499d4

Please sign in to comment.