From f80027f7b7fc5422c04296a843ff9a4dd5c99fc0 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Thu, 28 Dec 2023 14:56:51 -0500 Subject: [PATCH] fix: studio generated assertions now use proper past tense for assertions (#28593) * Fix studio generated assertions to use proper past tense of assertions * changelog entry --------- Co-authored-by: Emily Rohrbough --- cli/CHANGELOG.md | 8 ++++++++ packages/app/cypress/e2e/studio/studio.cy.ts | 10 +++++----- packages/app/src/store/studio-store.ts | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 6020238b62..c1eeec0c4b 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,4 +1,12 @@ +## 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_ diff --git a/packages/app/cypress/e2e/studio/studio.cy.ts b/packages/app/cypress/e2e/studio/studio.cy.ts index f72c84897a..617494c877 100644 --- a/packages/app/cypress/e2e/studio/studio.cy.ts +++ b/packages/app/cypress/e2e/studio/studio.cy.ts @@ -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 to be enabled') + cy.get('.command-name-assert').should('contain.text', 'expected to be enabled') // (2) Assert Visible - cy.get('.command-name-assert').should('contain.text', 'expect to be visible') + cy.get('.command-name-assert').should('contain.text', 'expected to be visible') // (3) Assert Text - cy.get('.command-name-assert').should('contain.text', 'expect to have text Increment') + cy.get('.command-name-assert').should('contain.text', 'expected to have text Increment') // (4) Assert Id - cy.get('.command-name-assert').should('contain.text', 'expect to have id increment') + cy.get('.command-name-assert').should('contain.text', 'expected to have id increment') // (5) Assert Attr - cy.get('.command-name-assert').should('contain.text', 'expect to have attr onclick with the value increment()') + cy.get('.command-name-assert').should('contain.text', 'expected to have attr onclick with the value increment()') }) cy.get('button').contains('Save Commands').click() diff --git a/packages/app/src/store/studio-store.ts b/packages/app/src/store/studio-store.ts index d9ac81e692..3b924249d3 100644 --- a/packages/app/src/store/studio-store.ts +++ b/packages/app/src/store/studio-store.ts @@ -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]}**`