Skip to content

Commit

Permalink
Merge pull request #342 from emilekanaan/patch-1
Browse files Browse the repository at this point in the history
Fix typo in how-to-test-multiple-pages.mdx
  • Loading branch information
jennifer-shehane authored Dec 2, 2024
2 parents 93dcca1 + b3f2f58 commit ab55ee0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ context("Courses section", () => {

If we run our test, you will see that Cypress has found four `<a>` tags within the `<div data-test="course-0">` element. In a previous test, we used [eq](https://docs.cypress.io/api/commands/eq) to select a specific element from the returned array. However, using the `eq` method here would lead to a brittle test if a lesson is added or removed from the course.

Instead, we can use the [contains](https://docs.cypress.io/api/commands/contains) method that we also used previously. We can look for the text 'Getting started', which will select the `<a>` tag we want:
Instead, we can use the [contains](https://docs.cypress.io/api/commands/contains) method that we also used previously. We can look for the text 'Get started', which will select the `<a>` tag we want:

```jsx
context("Courses section", () => {
Expand Down

0 comments on commit ab55ee0

Please sign in to comment.