Skip to content

Commit b2c959d

Browse files
committed
Remove assertion chaining
1 parent cef3d7b commit b2c959d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cypress/e2e/features.cy.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const FIXTURES = {
1313
USERS_COUNT: 1,
1414
CATEGORIES_COUNT: 2,
1515
CONTENT_COUNT: 2,
16-
RESTAURANTS_COUNT: 2,
16+
RESTAURANTS_COUNT: 3,
1717
}
1818

1919
describe('Meilisearch features', () => {
@@ -155,13 +155,15 @@ describe('Meilisearch features', () => {
155155
cy.wrap(checkbox).click({ force: true })
156156
cy.wait('@addCollection')
157157
cy.wait('@fetchCollections') // wait for the refetch after the POST
158+
} else {
159+
cy.fail('The checkbox should not be checked')
158160
}
159161
})
160162

161163
// Re-select the row after the network sync to avoid stale element references
162-
cy.get(rowSelector)
163-
.should('contain.text', 'Yes')
164-
.and('contain.text', 'Hooked')
164+
// There can be delays until the state is updated, so wait for each separately
165+
cy.get(rowSelector).contains('Yes') // First, wait for the 'Yes' to appear
166+
cy.get(rowSelector).contains('Hooked') // Then, wait for the 'Hooked' to appear
165167
})
166168
})
167169

0 commit comments

Comments
 (0)