Skip to content

Commit 35763ff

Browse files
authored
Merge pull request #638 from meilisearch/fix-tests
Fix assertions on cypress tests after meili v0.25 update
2 parents 74b35d2 + 2e08688 commit 35763ff

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

cypress/integration/search-ui.spec.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ describe(`${playground} playground test`, () => {
5757
})
5858

5959
it('click on facets', () => {
60+
cy.get(HIT_ITEM_CLASS).eq(0).contains('Counter-Strike')
61+
6062
const checkbox = `.ais-RefinementList-list .ais-RefinementList-checkbox`
6163
cy.get(checkbox).eq(1).click()
64+
6265
if (playground === 'react') cy.contains('1,939')
6366
if (playground === 'angular') cy.contains('1939')
64-
cy.get(HIT_ITEM_CLASS)
65-
.eq(0)
66-
.contains('Safecracker: The Ultimate Puzzle Adventure')
67-
cy.get(HIT_ITEM_CLASS).eq(0).contains('4.99 $')
67+
68+
cy.contains('Counter-Strike').should('not.exist')
6869
})
6970

7071
it('Search', () => {
@@ -87,14 +88,19 @@ describe(`${playground} playground test`, () => {
8788
})
8889

8990
it('Paginate Search', () => {
91+
cy.get(HIT_ITEM_CLASS).eq(0).contains('Counter-Strike')
92+
9093
if (playground === 'react') {
9194
cy.get('.ais-InfiniteHits-loadMore').click()
9295
cy.get(HIT_ITEM_CLASS).should('have.length', 12)
9396
} else {
94-
if (playground === 'vue') cy.get('.ais-Pagination-item').eq(3).click()
95-
else cy.get('.ais-Pagination-item--page').eq(1).click()
96-
cy.wait(500)
97-
cy.get(HIT_ITEM_CLASS).eq(0).contains('Darwinia')
97+
if (playground === 'vue') {
98+
cy.get('.ais-Pagination-item').eq(3).click()
99+
} else {
100+
cy.get('.ais-Pagination-item--page').eq(1).click()
101+
}
102+
103+
cy.contains('Counter-Strike').should('not.exist')
98104
}
99105
})
100106
})

0 commit comments

Comments
 (0)