Skip to content

Commit

Permalink
fix ref in alias example (#5334)
Browse files Browse the repository at this point in the history
  • Loading branch information
bulatgab committed Jun 26, 2023
1 parent ad96b1b commit c1e1c0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guides/core-concepts/variables-and-aliases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,12 @@ cy.then(function () {
cy.get('@favoriteColor').then(function (aliasValue) {
expect(aliasValue).to.eql('red')

expect(this.color).to.eql('blue')
expect(this.favoriteColor).to.eql('blue')
})
```

In the second `.then()` block, `cy.get('@favoriteColor')` runs
`cy.wrap(favorites).its('color')` fresh each time, but `this.color` was set when
`cy.wrap(favorites).its('color')` fresh each time, but `this.favoriteColor` was set when
the alias was first stored, back when our favorite color was blue.

### Elements
Expand Down

0 comments on commit c1e1c0b

Please sign in to comment.