Skip to content

Commit 2f5d180

Browse files
authored
Update part5d.md
1 parent 13222cb commit 2f5d180

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/5/en/part5d.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,8 @@ Make a test which checks that the blogs are ordered according to likes with the
11391139
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:
11401140
11411141
```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')
11441144
```
11451145
11461146
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

Comments
 (0)