You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/5/en/part5d.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1139,8 +1139,8 @@ Make a test which checks that the blogs are ordered according to likes with the
1139
1139
This exercise is quite a bit trickier than the previous ones. One solution is to add a certain class for the element which wraps the blog's content and use the [eq](https://docs.cypress.io/api/commands/eq#Syntax)-method to get the blog element in a specific index:
1140
1140
1141
1141
```js
1142
-
cy.get('.blog').eq(0).should('contain', 'The title of the first blog')
1143
-
cy.get('.blog').eq(1).should('contain', 'The title of the second blog')
1142
+
cy.get('.blog').eq(0).should('contain', 'The title with the most likes')
1143
+
cy.get('.blog').eq(1).should('contain', 'The title with the second most likes')
1144
1144
```
1145
1145
1146
1146
Note that you might end up having problems if you click a like button many times in row. It might be that cypress does the clicking so fast that it does not have time to update the app state in between the clicks. One remedy for this is to wait for the number of likes to update in between all clicks.
0 commit comments