Skip to content

Commit

Permalink
fix: studio generated assertions now use proper past tense for assert…
Browse files Browse the repository at this point in the history
…ions (cypress-io#28593)

* Fix studio generated assertions to use proper past tense of assertions

* changelog entry

---------

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
  • Loading branch information
jennifer-shehane and emilyrohrbough committed Dec 28, 2023
1 parent acb9087 commit f80027f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.6.3

_Released 1/2/2024 (PENDING)_

**Bugfixes:**

- When generating assertions via Cypress Studio, the preview of the generated assertions now correctly displays the past tense of 'expected' instead of 'expect'. Fixed in [#28593](https://github.com/cypress-io/cypress/pull/28593).

## 13.6.2

_Released 12/26/2023_
Expand Down
10 changes: 5 additions & 5 deletions packages/app/cypress/e2e/studio/studio.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ it('visits a basic html page', () => {
cy.get('.command-name-assert').should('have.length', 5)

// (1) Assert Enabled
cy.get('.command-name-assert').should('contain.text', 'expect <button#increment> to be enabled')
cy.get('.command-name-assert').should('contain.text', 'expected <button#increment> to be enabled')

// (2) Assert Visible
cy.get('.command-name-assert').should('contain.text', 'expect <button#increment> to be visible')
cy.get('.command-name-assert').should('contain.text', 'expected <button#increment> to be visible')

// (3) Assert Text
cy.get('.command-name-assert').should('contain.text', 'expect <button#increment> to have text Increment')
cy.get('.command-name-assert').should('contain.text', 'expected <button#increment> to have text Increment')

// (4) Assert Id
cy.get('.command-name-assert').should('contain.text', 'expect <button#increment> to have id increment')
cy.get('.command-name-assert').should('contain.text', 'expected <button#increment> to have id increment')

// (5) Assert Attr
cy.get('.command-name-assert').should('contain.text', 'expect <button#increment> to have attr onclick with the value increment()')
cy.get('.command-name-assert').should('contain.text', 'expected <button#increment> to have attr onclick with the value increment()')
})

cy.get('button').contains('Save Commands').click()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/store/studio-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ export const useStudioStore = defineStore('studioRecorder', {
const elementString = stringifyActual($el)
const assertionString = args[0].replace(/\./g, ' ')

let message = `expect **${elementString}** to ${assertionString}`
let message = `expected **${elementString}** to ${assertionString}`

if (args[1]) {
message = `${message} **${args[1]}**`
Expand Down

0 comments on commit f80027f

Please sign in to comment.