From 3ff67d31a65e504bc046a9dbed7b566e762b8ee5 Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Mon, 7 Oct 2024 15:01:10 +0530 Subject: [PATCH] test: Update Inline_editing_3_spec.js to include expected JSON parsing (#36721) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Root cause This spec was failing because it was string comparing the values, whereas the source was a JS Object. This sometimes caused spec to fail. Solution This pull request updates the `Inline_editing_3_spec.js` file to include the expected JSON parsing. The changes ensure that the correct JSON parsing is performed when editing a table cell and saving the changes. Fixes #36720 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Table" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 0cf810ba36f9947f9aff6c85c6c8d64bc7f1dbf3 > Cypress dashboard. > Tags: `@tag.Table` > Spec: >
Mon, 07 Oct 2024 09:27:17 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **Bug Fixes** - Improved validation for inline editing functionality in table widget tests. - Enhanced assertions for save/discard operations to ensure accuracy after changes. - Added checks for various column types in the `onsubmit` event tests. - **Tests** - Expanded end-to-end tests for inline editing, ensuring thorough validation across scenarios. - Incorporated additional checks for the display and retention of values during editing operations. --- .../Widgets/TableV2/Inline_editing_3_spec.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js index 40da3f138e..5a27f59e1e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js @@ -4,6 +4,7 @@ import { agHelper, table as tableHelper, propPane, + locators, } from "../../../../../support/Objects/ObjectsCore"; import { PROPERTY_SELECTOR } from "../../../../../locators/WidgetLocators"; @@ -148,10 +149,16 @@ describe( cy.editTableCell(0, 0); cy.enterTableCellValue(0, 0, "newValue"); cy.saveTableCellValue(0, 0); - cy.get(".t--widget-textwidget .bp3-ui-text").should( - "contain", - `[ { "index": 0, "updatedFields": { "step": "newValue" }, "allFields": { "step": "newValue", "task": "Drop a table", "status": "✅" } }]`, - ); + const exected = [ + { + index: 0, + updatedFields: { step: "newValue" }, + allFields: { step: "newValue", task: "Drop a table", status: "✅" }, + }, + ]; + agHelper + .GetText(locators._textWidget, "text") + .should((text) => expect(JSON.parse(text)).to.deep.equal(exected)); cy.openPropertyPane("textwidget"); cy.updateCodeInput( ".t--property-control-text",